-
Notifications
You must be signed in to change notification settings - Fork 0
/
out3.txt
173 lines (139 loc) · 9.93 KB
/
out3.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
Press 1: For Inbuilt testCase
Press 2: For Custom testCase
2
Enter Number of clients
2
Enter 0 to exit
Enter 1 to continue 1
Total Clients
-------------------------------------------------------------------------
| Client Id | Ip address | Mac Address |
-------------------------------------------------------------------------
| 2 | 23.23.23.01 | ef:ds:fd:ef:ds:01 |
| 1 | 23.23.23.00 | ef:ds:fd:ef:ds:00 |
-------------------------------------------------------------------------
Enter Source Client id 1
Enter Destination Client id 2
Now Source will find mac Address of the Destination whose Ip address is : ( 23.23.23.01 )
***** Client 1 request mac Address for the given 23.23.23.01 Ip address ******
Present:
ARP CACHE OF client1:
-------------------------------------------------
| Ip address | Mac Address |
-------------------------------------------------
-------------------------------------------------
MAC Address for the sender Ip Address ( 23.23.23.01 ) is not availble in the cache of Client 1. So there's need to send Arp request
ARP_REQUEST Packet:
-------------------------------------------------------------------------------------------------------------------------------------------------
| Source Ip address | Source Mac Address | Dest IP Address | Dest Mac Address | Operation Code |
-------------------------------------------------------------------------------------------------------------------------------------------------
| 23.23.23.00 | ef:ds:fd:ef:ds:00 | 23.23.23.01 | ff:ff:ff:ff:ff:ff | ARP_REQUEST |
-------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
| Hardware Type | Hardware Length | Protocol Type | Protocol Length |
-------------------------------------------------------------------------------------------------
| 1 | 6 | 0x0800 | 4 |
-------------------------------------------------------------------------------------------------
*** ARP packet arrives at Network Switch ***
ARP_REQUEST Packet:
-------------------------------------------------------------------------------------------------------------------------------------------------
| Source Ip address | Source Mac Address | Dest IP Address | Dest Mac Address | Operation Code |
-------------------------------------------------------------------------------------------------------------------------------------------------
| 23.23.23.00 | ef:ds:fd:ef:ds:00 | 23.23.23.01 | ff:ff:ff:ff:ff:ff | ARP_REQUEST |
-------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
| Hardware Type | Hardware Length | Protocol Type | Protocol Length |
-------------------------------------------------------------------------------------------------
| 1 | 6 | 0x0800 | 4 |
-------------------------------------------------------------------------------------------------
Network Switch: As the destination mac address is ff:ff:ff:ff:ff:ff, so it is broadcast ARP_REQUEST
Network Switch: Broadcasting the ARP PAcket from Network switch
***** Client 2 receives ARP packet from Network switch ******
ARP_REQUEST Packet:
-------------------------------------------------------------------------------------------------------------------------------------------------
| Source Ip address | Source Mac Address | Dest IP Address | Dest Mac Address | Operation Code |
-------------------------------------------------------------------------------------------------------------------------------------------------
| 23.23.23.00 | ef:ds:fd:ef:ds:00 | 23.23.23.01 | ff:ff:ff:ff:ff:ff | ARP_REQUEST |
-------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
| Hardware Type | Hardware Length | Protocol Type | Protocol Length |
-------------------------------------------------------------------------------------------------
| 1 | 6 | 0x0800 | 4 |
-------------------------------------------------------------------------------------------------
Updated Arp cache of client 2
ARP CACHE OF client2:
-------------------------------------------------
| Ip address | Mac Address |
-------------------------------------------------
| 23.23.23.00 | ef:ds:fd:ef:ds:00 |
-------------------------------------------------
Client 2 IP address ( 23.23.23.01 ) matches with the ARP request destination IP Address ( 23.23.23.01 )
Client 2: Sending back ARP response to the source IP address of the ARP Request
ARP_RESPONSE Packet:
-------------------------------------------------------------------------------------------------------------------------------------------------
| Source Ip address | Source Mac Address | Dest IP Address | Dest Mac Address | Operation Code |
-------------------------------------------------------------------------------------------------------------------------------------------------
| 23.23.23.01 | ef:ds:fd:ef:ds:01 | 23.23.23.00 | ef:ds:fd:ef:ds:00 | ARP_RESPONSE |
-------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
| Hardware Type | Hardware Length | Protocol Type | Protocol Length |
-------------------------------------------------------------------------------------------------
| 1 | 6 | 0x0800 | 4 |
-------------------------------------------------------------------------------------------------
*** ARP packet arrives at Network Switch ***
ARP_RESPONSE Packet:
-------------------------------------------------------------------------------------------------------------------------------------------------
| Source Ip address | Source Mac Address | Dest IP Address | Dest Mac Address | Operation Code |
-------------------------------------------------------------------------------------------------------------------------------------------------
| 23.23.23.01 | ef:ds:fd:ef:ds:01 | 23.23.23.00 | ef:ds:fd:ef:ds:00 | ARP_RESPONSE |
-------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
| Hardware Type | Hardware Length | Protocol Type | Protocol Length |
-------------------------------------------------------------------------------------------------
| 1 | 6 | 0x0800 | 4 |
-------------------------------------------------------------------------------------------------
Network Switch: As the destination mac address is ef:ds:fd:ef:ds:00, so it is Unicast ARP_REPLY
Network Switch: SENDING the ARP_REPLY to client with mac = ef:ds:fd:ef:ds:00
***** Client 1 receives ARP packet from Network switch ******
ARP_RESPONSE Packet:
-------------------------------------------------------------------------------------------------------------------------------------------------
| Source Ip address | Source Mac Address | Dest IP Address | Dest Mac Address | Operation Code |
-------------------------------------------------------------------------------------------------------------------------------------------------
| 23.23.23.01 | ef:ds:fd:ef:ds:01 | 23.23.23.00 | ef:ds:fd:ef:ds:00 | ARP_RESPONSE |
-------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------------------
| Hardware Type | Hardware Length | Protocol Type | Protocol Length |
-------------------------------------------------------------------------------------------------
| 1 | 6 | 0x0800 | 4 |
-------------------------------------------------------------------------------------------------
Updated Arp cache of client 1
ARP CACHE OF client1:
-------------------------------------------------
| Ip address | Mac Address |
-------------------------------------------------
| 23.23.23.01 | ef:ds:fd:ef:ds:01 |
-------------------------------------------------
Client 1 get back the mac address ( ef:ds:fd:ef:ds:01 ) for the IP address ( 23.23.23.01 )
Enter 0 to exit
Enter 1 to continue 1
Total Clients
-------------------------------------------------------------------------
| Client Id | Ip address | Mac Address |
-------------------------------------------------------------------------
| 2 | 23.23.23.01 | ef:ds:fd:ef:ds:01 |
| 1 | 23.23.23.00 | ef:ds:fd:ef:ds:00 |
-------------------------------------------------------------------------
Enter Source Client id 1
Enter Destination Client id 2
Now Source will find mac Address of the Destination whose Ip address is : ( 23.23.23.01 )
***** Client 1 request mac Address for the given 23.23.23.01 Ip address ******
Present:
ARP CACHE OF client1:
-------------------------------------------------
| Ip address | Mac Address |
-------------------------------------------------
| 23.23.23.01 | ef:ds:fd:ef:ds:01 |
-------------------------------------------------
MAC Address for the sender Ip Address ( 23.23.23.01 ) is availble in the cache of Client 1. So no need to send Arp request
Enter 0 to exit
Enter 1 to continue 0