Skip to content

Commit d8ae93e

Browse files
committed
Updated && All Solutions Added!!
1 parent b2fe575 commit d8ae93e

File tree

10 files changed

+49
-27
lines changed

10 files changed

+49
-27
lines changed

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
## ✅ Network Programming
22

3-
![Network-Programming](https://socialify.git.ci/anuj-das-10/Network-Programming/image?description=1&descriptionEditable=CSC-DSE-502-L%20-%3E%20Network%20Programming%20LAB%20(Solutions)&font=Inter&forks=1&language=1&name=1&owner=1&pattern=Signal&stargazers=1&theme=Dark)
3+
![Network-Programming](https://socialify.git.ci/anuj-das-10/Network-Programming/image?description=1&descriptionEditable=CSC-DSE-502-L%20-%3E%20Network%20Programming%20LAB%20(Solutions)&forks=1&language=1&name=1&owner=1&pattern=Signal&stargazers=1&theme=Dark)
44

55

66
### 🤔Not familiar with GitHub Interface?
@@ -31,49 +31,49 @@
3131

3232
#### Q1)   Simulate Cyclic Redundancy Check (CRC) error detection algorithm for noisy channel.
3333

34-
- ###### [See Solution using Java]()
34+
- ###### [See Solution using Java](https://github.com/anuj-das-10/Network-Programming/blob/main/Solutions/Q-01/CRC_ErrorDetectionAlgorithm.java)
3535
#
3636

3737

3838
#### Q2)   Simulate and implement stop and wait protocol for noisy channel.
3939

40-
- ###### [See Solution using Java]()
40+
- ###### [See Solution using Java](https://github.com/anuj-das-10/Network-Programming/blob/main/Solutions/Q-02/StopAndWaitARQ.java)
4141
#
4242

4343

4444
#### Q3)   Simulate and implement Go-Back-N Sliding Window Protocol.
4545

46-
- ###### [See Solution using Java]()
46+
- ###### [See Solution using Java](https://github.com/anuj-das-10/Network-Programming/blob/main/Solutions/Q-03/GoBackN.java)
4747
#
4848

4949

5050
#### Q4)   Simulate and implement Distance Vector Routing Algorithm.
5151

52-
- ###### [See Solution using Java]()
52+
- ###### [See Solution using Java](https://github.com/anuj-das-10/Network-Programming/blob/main/Solutions/Q-04/DistanceVectorRouting.java)
5353
#
5454

5555

5656
#### Q5)   Simulate and implement Dijkstra Algorithm for shortest path routing.
5757

58-
- ###### [See Solution using Java]()
58+
- ###### [See Solution using Java](https://github.com/anuj-das-10/Network-Programming/blob/main/Solutions/Q-05/DijkstraAlgorithm.java)
5959
#
6060

6161

6262
#### Q6)   Program to find the address of the local machine.
6363

64-
- ###### [See Solution using Java]()
64+
- ###### [See Solution using Java](https://github.com/anuj-das-10/Network-Programming/blob/main/Solutions/Q-06/GetLocalHostAddress.java)
6565
#
6666

6767

6868
#### Q7)   Program that prints the address of www.youtube.com
6969

70-
- ###### [See Solution using Java]()
70+
- ###### [See Solution using Java](https://github.com/anuj-das-10/Network-Programming/blob/main/Solutions/Q-07/GetIPAddress.java)
7171
#
7272

7373

7474
#### Q8)   Program that prints all the addresses of www.youtube.com
7575

76-
- ###### [See Solution using Java]()
76+
- ###### [See Solution using Java](https://github.com/anuj-das-10/Network-Programming/blob/main/Solutions/Q-08/GetAllAddresses.java)
7777
#
7878

7979

@@ -84,7 +84,7 @@ public String getHostAddress()
8484
public byte[] getAddress()
8585
```
8686

87-
- ###### [See Solution using Java]()
87+
- ###### [See Solution using Java](https://github.com/anuj-das-10/Network-Programming/blob/main/Solutions/Q-09/InetMethodsDemonstration.java)
8888

8989
#
9090

Solutions/Q-01/CRC_ErrorDetectionAlgorithm.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Contributed by - Anuj Das ( GC University, Silchar - @ Department of Computer Science )
2+
13
// 1. Simulate Cyclic Redundancy Check (CRC) Error Detection Algorithm for Noisy Channel.
24

35
import java.util.Scanner;

Solutions/Q-02/StopAndWaitARQ.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
1+
// Contributed by - Anuj Das ( GC University, Silchar - @ Department of Computer Science )
12

3+
// 2. Simulate and implement Stop And Wait ARQ protocol for noisy channel.
24

3-
/*
4-
5-
This program simulates the stop-and-wait protocol for a noisy channel by sending messages, receiving ACKs or corrupted messages, and
6-
handling timeouts. In a real implementation, you would send the messages and receive ACKs through a network connection, and use a timer
7-
to handle timeouts. However, this program uses simulated methods to send messages, start timers, and receive messages to make it easier
8-
to test and understand the stop-and-wait protocol.
9-
10-
*/
115
import java.util.Random;
126

137
class StopAndWaitARQ {
@@ -131,3 +125,12 @@ public static void main(String[] args) {
131125

132126

133127

128+
129+
/*
130+
131+
This program simulates the stop-and-wait protocol for a noisy channel by sending messages, receiving ACKs or corrupted messages, and
132+
handling timeouts. In a real implementation, you would send the messages and receive ACKs through a network connection, and use a timer
133+
to handle timeouts. However, this program uses simulated methods to send messages, start timers, and receive messages to make it easier
134+
to test and understand the stop-and-wait protocol.
135+
136+
*/

Solutions/Q-03/GoBackN.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// Contributed by - Anuj Das ( GC University, Silchar - @ Department of Computer Science )
2+
3+
// 3. Simulate and implement Go-Back-N Sliding Window Protocol.
4+
15
import java.util.Arrays;
26

37
class GoBackN {

Solutions/Q-04/DistanceVectorRouting.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// 4. Simulate and implement distance vector routing algorithm.
1+
// Contributed by - Anuj Das ( GC University, Silchar - @ Department of Computer Science )
2+
3+
// 4. Simulate and implement Distance Vector Routing Algorithm.
24

35
import java.io.*;
46

Solutions/Q-05/DijkstraAlgorithm.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// Dijkstra's Algorithm in Java
1+
// Contributed by - Anuj Das ( GC University, Silchar - @ Department of Computer Science )
2+
3+
// 5. Simulate and implement Dijkstra Algorithm for Shortest Path Routing.
24

35
public class DijkstraAlgorithm {
46

Solutions/Q-06/GetLocalHostAddress.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Contributed by - Anuj Das ( GC University, Silchar - @ Department of Computer Science )
2+
13
// 6. WAP to find the address of the local machine.
24

35
import java.net.*;

Solutions/Q-07/GetIPAddress.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
// 3. Simulate and implement go back n sliding window protocol.
1+
// Contributed by - Anuj Das ( GC University, Silchar - @ Department of Computer Science )
2+
3+
// 7. WAP A program that prints the address of www.youtube.com
24

35
import java.io.IOException;
46
import java.net.*;

Solutions/Q-08/GetAllAddresses.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// Contributed by - Anuj Das ( GC University, Silchar - @ Department of Computer Science )
2+
13
// 8. WAP A program that prints all the addresses of www.youtube.com
24

35
import java.net.InetAddress;
@@ -12,7 +14,7 @@ public static void main(String args[]){
1214

1315
try {
1416
InetAddress[] myHost = InetAddress.getAllByName(web_url);
15-
System.out.println("\nAll Addresses of "+web_url+" :");
17+
System.out.println("\nAll Addresses of "+ web_url +" :");
1618
for(InetAddress host:myHost) {
1719
System.out.println(host.getHostAddress());
1820
}
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1+
// Contributed by - Anuj Das ( GC University, Silchar - @ Department of Computer Science )
2+
3+
// 9. Write a program to implement following methods:
4+
// - public String getHostName()
5+
// - public byte[] getAddress()
6+
// - public String getHostAddress()
7+
18
import java.net.InetAddress;
29
import java.net.UnknownHostException;
310
import java.util.Arrays;
411
import java.util.Scanner;
512

613
class InetMethodsDemonstration {
7-
public static void main(String[] args) throws UnknownHostException{
14+
public static void main(String[] args) throws UnknownHostException {
815
Scanner sc = new Scanner(System.in);
916

1017
InetAddress local = InetAddress.getLocalHost();
@@ -17,9 +24,5 @@ public static void main(String[] args) throws UnknownHostException{
1724
byte []addressBytes = host.getAddress();
1825

1926
System.out.println(Arrays.toString(addressBytes));
20-
21-
22-
23-
2427
}
2528
}

0 commit comments

Comments
 (0)