DCN Practical 2
DCN Practical 2
Practical-2
AIM: Understand and identify header fields of layers of TCP/IP protocol stack.
Watch and refer following videos for a better understanding of the header fields of layers of
TCP/IP:
Students need to fill the empty table and write answers to questions.
As per the discussion in classroom, any user starts internet access through browser or network
applications. Following figure 2.1 explain scenario of receiving data at NIC Card. NIC card receives
signals and it converts into sequence of 0’s and 1‘s. After receiving data it sends data for the further
processing to TCP/IP protocol stack. In this exercise you need to identify boundaries of fields of
headers, describe and understand flow of information in protocol stack.
This is the data stream which receiver NIC card receives from wire and stores into memory. Length of
bits stream is 432 bits.
0000000000011010100011000110101101110110101011001110100011011000110100010100011
1111001111110001000010000000000001000101000000000000000000101000000101011011110
0100000000000000100000000000011000000000000000001010110000010000000011000111101
1000111011111010101101110100111011000101011100110000000110111011010010011110111
0111110100011010111100100000100000011010001001110101000000010000000100000000101
0
1111111011101110000000000000000
0
Abstract view of data with respect to the location of headers and data in the actual data stream.
Data Link (Ethernet) Network Transport Data
Header Header Header
Initial 112 bits contains Ethernet Header (Refer section 2.2), Next 160 bits contains IP Header (Refer
section 2.3), Next 160 bits contains TCP Header (Refer section 2.4).
Section 2.1 contains bit stream. copy and paste respected number of bits into following table 2.1 to prepare
ethernet header field boundary.
Section 2.1 contains bit stream. copy and paste respected number of bits into following table 2.3 to prepare
ethernet header field boundary.
10101100000100000000110001111011
10001110111110101011011101001110
From table 2.3, fill table 2.4 with respected value and explanation meaning of each field. Refer the
following link for better understanding. Refer video 2 in material 2 for further understanding.
Reference Links:
https://en.wikipedia.org/wiki/IPv4#Header
DCSP & ECN: https://en.wikipedia.org/wiki/Type_of_service#DSCP_and_ECN
Flags: https://en.wikipedia.org/wiki/IPv4#Flags
Protocol: https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers
Table 2.4 Header fields of Network
Header Field Length of Header field Meaning
Name Field (in Value (Hex Value)
bits)
Version 4 bits 0x4 IP Datagram version 4
IHL 4 bites 0x5 5*32bits=160bits=20bytes
DSCP 6 bits 0x0 ---
ECN 2 bits 0x0 ---
Total length 16 bits 0x28 Total length of 40 bytes
D23DCS147 CE257 DATA COMMUNICATION NETWORK
Section 2.1 contains bit stream. copy and paste respected number of bits into following table 2.5 to
prepare ethernet header field boundary.
Table 2.5 Header fields of transport layer
1100010101110011 0000000110111011
01001001111011110111110100011010
11110010000010000001101000100111
1111111011101110 0000000000000000
D23DCS147 CE257 DATA COMMUNICATION NETWORK
From table 2.5, fill table 2.6 with respected value and explanation meaning of each field. Refer the
following link for better understanding. Refer video 4 in material 4 for further understanding.
Reference Link :
https://en.wikipedia.org/wiki/Transmission_Control_Protocol#TCP_segment_structure
Flags: https://www.gatevidyalay.com/transmission-control-protocol-tcp-header/
Port : https://www.adminsub.net/tcp-udp-port-finder/
Exercise-3:
InputSequence:
ARPBroadcast
1111111111111111111111111111111111111111111111111110000001100011110110100101010
00111000101000100000010000000011000000000000000010000100000000000000001100000010
00000000000000001111000000110001111011010010101000111000101000100101011000001000
00000100000100001000000000000000000000000000000000000000000000000101011000001000
0
00000111100111010000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000
Address 4:71:44
Type 16 bits 0x806 0x806 indicates, Network Header type is
Address Resolution Protocol (ARP)
Header fields of Ethernet
Header Field Length of Header field Meaning
Name Field (in Value (Hex
bits) Value)
Source Port 16 bits 59168 Sender machine’s application’s logical port
number 59168
Destination 16 bits 3389 Receiver machine’s receiving logical port
Port number 3389 which indicates source wants
communicate security using https protocol.
Sequence 32 bits 0x148D3F Unique ID assigned by sender to maintain
Number order of packers at receiver side.
Acknowledgem 32 bits 0xF48005E7 This is acknowledged by the sent packet.
ent Number
Header Length 4 bits 0x0 Total header Length is 0 bytes
Reserved Bits 6 bits 0x10 Total reserved bits is 6 bits = 6*4 bits = 24
bytes
URG 1 bit 0
ACK 1 bit 1 This packet 1 contains valid
acknowledgement number.
PSH 1 bit 0 No Push
RST 1 bit 0 No RST
SYN 1 bit 0 No SYN
FIN 1 bit 0 NO Fin
Window Size 16 bits 1
Checksum 16 bits 0X1 Error identification in packet.
Urgent Pointer 16 bits 0xFD9 urgent content in this packet at FD9.
Header fields of network
Header Field Length of Header field Meaning
Name Field (in Value (Hex Value)
bits)
Version 4 bits 0x0 ---
IHL 4 bites 0x0 ---
DSCP 6 bits 0x0 ---
ECN 2 bits 0x1
Total length 16 bits 0x800 Total length of 2048 bytes
Identification 16 bits 0x604
flags 3 bits 0x0 This packet does not contain flags.
Fragment 13 bits 0x1 This packet contain fragments offset.
offset
D23DCS147 CE257 DATA COMMUNICATION NETWORK
3. What is the full form of the MAC address? What is the significance of source and
destination MAC address? Answer:
4. What is the full form of IP, TCP, UDP and ARP? Answer:
D23DCS147 CE257 DATA COMMUNICATION NETWORK
Gate Questions:
1. What is the maximum size of data that the application layer can pass on to the TCP layer
below? A) Any size
B) 216 bytes - size of TCP header
C) 216 bytes
D) 1500 bytes Ans:
2. The protocol data unit (PDU) for the application layer in the Internet stack is:
A) Segment
B) Datagram
C) Message
D) Frame Ans:
3. A TCP message consisting of 2100 bytes is passed to IP for delivery across two networks. The
first network can carry a maximum payload of 1200 bytes per frame and the second
network can carry a maximum payload of 400 bytes per frame, excluding network
overhead. Assume that IP overhead per packet is 20 bytes. What is the total IP overhead in
the second network for this transmission?
A) 40 bytes
B) 80 bytes
C) 120 bytes
D) 160 bytes Ans:
6. Consider the following statements about the timeout value used in TCP.
i. The timeout value is set to the RTT (Round Trip Time) measured during TCP
connection establishment for the entire duration of the connection.
ii. Appropriate RTT estimation algorithm is used to set the timeout value of a TCP
connection.
iii. Timeout value is set to twice the propagation delay from the sender to the
receiver. Which of the following choices hold?
A)(i) is false, but (ii) and (iii) are true
B)(i) and (iii) are false, but (ii) is true
C)(i) and (ii) are false, but (iii) is true
D)(i), (ii) and (iii) are false
Ans:
D23DCS147 CE257 DATA COMMUNICATION NETWORK
7. Consider an IP packet with a length of 4,500 bytes that includes a 20-byte IPv4 header ans
40- byte TCP header. The packet is forwarded to an IPv4 router that supports a Maximum
Transmission Unit (MTU) of 600 bytes. Assume that the length of the IP header in all the
outgoing fragments of this packet is 20 bytes. Assume that the fragmentation offset value
stored in the first fragment is 0.
The fragmentation offset value stored in the third fragment is .
Note –This was ..Numerical Type question.
A) 0
B) 72
C) 144
D) 216
Ans:
8. Consider two hosts P and Q connected through a router R. The maximum transfer unit
(MTU) value of the link between P and R is 1500 bytes, and between R and Q is 820 bytes.
A) TCP segment of size 1400 bytes was transferred from P to Q through R, with IP
identification value as 0×1234. Assume that the IP header size is 20 bytes. Further, the
packet is allowed to be fragmented, i.e., Don’t Fragment (DF) flag in the IP header is not set
by P.
10. In an IPv4 datagram, the M bit is 0, the value of HLEN is 10, the value of total length is 400
and the fragment offset value is 300. The position of the datagram, the sequence numbers of
the first and the last bytes of the payload, respectively are:
A) Last fragment, 2400 and 2789
B) First fragment, 2400 and 2759
C) Last fragment, 2400 and 2759
D) Middle fragment, 300 and 689 Ans:
D23DCS147 CE257 DATA COMMUNICATION NETWORK
11. The maximum number of IPv4 router addresses that can be listed in the record route (RR)
option field of an IPv4 header is .
Ans:
12. Consider an IP packet with a length of 4, 500 bytes that includes a 20 − byte IPv4 header ans
40 - byte TCP header. The packet is forwarded to an IPv4 router that supports a Maximum
Transmission Unit (MTU) of 600 bytes. Assume that the length of the IP header in all the
outgoing fragments of this packet is 20 bytes. Assume that the fragmentation offset value
stored in the first fragment is 0.
13. For which one of the following reasons does internet protocol(IP) use the time-to-live(TTL)
field in IP datagram header?
A) Ensure packets reach destination within that time
B) Discard packets that reach later than that time
C) Prevent packets from looping indefinitely
D) Limit the time for which a packet gets queued in intermediate routers Ans:
14. One of the header fields in an IP datagram is the Time-to-Live (TTL) field. Which of the
following statements best explains the need for this field? A) It can be used to prioritize
packets.
B) It can be used to reduce delays.
C) It can be used to optimize throughput.
D) It can be used to prevent packet looping. Ans:
15. Host A (on TCP/IP v4 network A) sends an IP datagram D to host B (also on TCP/IP v4
network B). Assume that no error occurred during the transmission of D. When D reaches
B, which of the following IP header field(s) may be different from that of the original
datagram D?
i. TTL
ii. Checksum iii. Fragment Offset
A) i only
B) i and ii only
C) ii and iii only
D) i, ii and iii Ans:
16. Host A sends a UDP datagram containing 8880 bytes of user data to host B over an Ethernet
LAN. Ethernet frames may carry data up to 1500 bytes (i.e. MTU = 1500 bytes). Size of UDP
header is 8 bytes and size of IP header is 20 bytes. There is no option field in IP header. How
many total number of IP fragments will be transmitted and what will be the contents of
offset field in the last fragment?
A) 6 and 925
B) 6 and 7400
C) 7 and 1110
D) 7 and 8880 Ans:
D23DCS147 CE257 DATA COMMUNICATION NETWORK
17. An IP datagram of size 1000 bytes arrives at a router. The router has to forward this packet
on a link whose MTU (maximum transmission unit) is 100 bytes . Assume that the size of the
IP header is 20 bytes .
The number of fragments that the IP datagram will be divided into for transmission is
.
Ans:
18. In the TCP/IP protocol suite, which one of the following is NOT part of the IP header?
A) Fragment Offset
B) Source IP address
C) Destination IP address
D) Destination port number Ans: