HW88
HW88
HW88
Add 1 PC to
each Ethernet. 3. Assign IP addresses to each PC and both router interfaces. 4. Select one PC as
the sender and the other PC as the receiver. Both PCs are running a tic-tac-toe game which is
based on UDP. The sender will send a “move” via a UDP packet to the receiver using UDP Port
1942 as the destination port and UDP port 1941 as the source port.
Using the information, you have created and the information given describe, in detail, the life of
the packet as it leaves the game application on the sender until it arrives at the receiver.
Let,
Interface 1 10.255.40.6
Router Router 00:0c:29: f0:03: a8
Interface 2 10.37.253.30
The game application sends the message to the transport layer which has to be sent to
the receiver.
In the transport layer (UDP) (in Device A):
UDP receives the message from the application layer and builds/encapsulates its own
header with the following fields.
UDP header (8 Bytes) contains the fields:
o Source Port (2 Bytes): 1941
o Destination Port (2 Bytes): 1942
o Total Length (Header + Data) (2 Bytes): 8+40
o Checksum (2 Bytes): It is optional in IPv4
Filled with 0’s if choose not to calculate it
If choose to calculate: 1's complement of sum of a pseudo UDP header +
UDP datagram.
o UDP sends the datagram to the IP layer.
In the Network Layer (IP) (in Device A): IP layer receives the UDP datagram (payload for IP) from
the transport layer.
In the Physical Layer (between Device A and Router Interface - 1): Electrically transmits the
frame
This Layer receives the Ethernet frame from the Data Link layer.
o It uses CSMA/CD as a transmission method
o It senses the medium
o If the medium is free, transmits the frame and keep on sensing.
o If collision occurs, it retransmits the frame (Exponential Back-off method).
At Layer 2(Router):
o This Layer receives the IP Packet from the Network layer.
o Building New Ethernet frame: Since, layer 2 connection is between 2 adjacent
host, every time for each new connection between 2 adjacent host, new ethernet
frame has to be build.
Preamble: used to synchronize receiver, sender clock rates
SFD: signals the beginning of the frame.
Destination MAC Address: link- layer address of the destination station
(Device B)
Source MAC Address: link- layer address of the source station(router)
Type: Upper-layer protocol whose packet is encapsulated in the frame.
(0x0800)
Data: data encapsulated from the upper-layer protocol (IP packet)
CRC: 1's complement of sum of calculated over the new addresses, types,
and data field.
o Now, the new Ethernet frame is given to the Physical Layer for transmitting.
In the Physical Layer (between Router Interface 2 and Device B): Electrically transmits the frame
This Layer receives the new Ethernet frame from the Data Link layer.
o It uses CSMA/CD as a transmission method
o It senses the medium
o If the medium is free, transmits the frame and keep on sensing.
o If collision occurs, it retransmits the frame (Exponential Back-off method).
In LAN B (all devices connected to):
The new Ethernet frame is received by all the nodes in the Ethernet2.
CRC is checked by all and sends it to layer 2.
At Layer 2(of all devices connected to LAN B):
o Layer 2 checks whether the destination MAC address matches with local MAC
address. In our case it matches.
o Then, it checks for the “Type field”, its “IP”, so it passes the packet to the IP layer
by stripping off the new Ethernet Header from the segment.
In the Network Layer (in Device B):
This Layer receives the IP Packet from the Data Link layer.
It checks for the IP checksum in the IP header.
It compares IP destination address with its own IP address, it matches.
It checks to which protocol the packet has to be delivered by looking the “Type field”. It
is UDP.
It passes the UDP Datagram to the UDP process after stripping off the IP Header from the
segment.
In the Transport Layer (in Device B):
Checks the checksum for error. If the checksum does not include pseudo header
and if the IP header is corrupted, the datagram may deliver to the wrong host. On
the other hand, if the protocol value is changed, UDP drops the packet.
Assuming there are no such cases, the transport layer strip off the UDP header
from the data and sends it to the application layer.
In the Application Layer (in Device B):