Lab/Tutorial :
SEHH2238 : Computer Networking
Session 8 : IP Protocol & Routing (Solution)
1. Can the value of the header length field in an IPv4 packet be less than 5? When is it exactly 5?
Copyright By PowCoder代写 加微信 powcoder
The minimum length of the IPv4 header is 20 bytes and the maximum is 60 bytes. The value of the header length field defines the header length in multiples of four bytes, which means that HLEN can be between 5 and 15. It cannot be less than 5 and it cannot be greater than 15. It is exactly 5 when there is no option.
2. An IP fragment has arrived with an offset value of 100. How many bytes of data were originally sent by the source before the data in this segment?
Since the fragmentation offset field shows the offset from the beginning of the original datagram in multiples of 8 bytes, an offset of 100 indicates that the first byte in this fragment is numbered 800, which means bytes numbered 0 to 799 (for a total of 800 bytes) were sent before.
3. A datagram (/fragment) has arrived with an offset value of 300 and the payload size is 100 bytes. What are the number (position) of the first byte and the last byte with respect to the original data?
a. The number of the first byte is 8 × 300 = 2400.
b. The number of the last byte is 2400 + 100 − 1 = 2499.
4. An IP datagram has arrived with the following partial information in the header (in hexadecimal) :
45000054 00030000 2006 …
a) What is the header size?
b) Are there any options in the packet?
c) What is the size of the data?
d) Is the packet fragmented?
e) How many more routers can the packet travel to?
f) What is the protocol number of the payload being carried by the packet?
We analyze each byte or group of bytes to answer the questions:
a. The second hex digit in the first byte is 5 (HLEN), which means that the header
length is only 5 × 4 = 20 bytes.
b. There are no options because the header size is only 20 bytes.
c. The total length of the packet is (0054)16 or 84 bytes. Since the header is 20 bytes, it
means the packet is carrying 64 bytes of data.
d. Since the flags field fragmentation offset bit is all 0s, the packet is not fragmented.
e. The value of the TTL field is (20)16 or 32 in decimal, which means the packet may
visit up to 32 more routers.
f. The value of the protocol field is 6, which means that the packet is carrying a
segment from the TCP protocol.
SEHH2238 Computer Networking Tutorial 8 Page 1
5. Consider sending a 4000-byte datagram into a link that has an MTU of 400 bytes. Suppose the original datagram is stamped with the identification number 422 and there is no optional field in the header. How many fragments are generated? What is the size of each fragment? What are the values of the ID, fragment flag and offset in each fragment?
Assume no optional field in the header, which implies the IP header has 20 bytes. The maximum size of data field in each fragment is 400 – 20 = 380 bytes. However 376-byte is used as the maximum data size because the data size must be a multiple of 8 bytes.
Thus the number of required fragments 4000 20 11 376
Each fragment except the last one will be of size 396 bytes (including IP header).
The last datagram will be of size 240 (= 3980 – 376×10 + 20) bytes (including IP header).
Each fragment will have Identification number 422.
The offsets of the 11 fragments will be 0, 47 (= 376/8), 94, 141, 188, 235, 282, 329, 376, 423 and 470.
Each of the first 10 fragments will have flag=1; the last fragment will have flag=0.
6. Why is an ARP query sent with a broadcast frame? Why is an ARP response sent within a frame with a specific destination MAC address?
An ARP query is sent in a broadcast frame because the querying host does not know which adapter address corresponds to the IP address in question. For the response, the sending node knows the adapter address to which the response should be sent, so there is no need to send a broadcast frame (which would have to be processed by all the other nodes on the LAN).
SEHH2238 Computer Networking Tutorial 8 Page 2
7. In the following network, how many entries are there in the IP routing table of A assuming that each network has 100 computers.
Note that the IP address of destination networks (not individual stations/computers) will be used in the IP routing table as shown in the right-hand-side table above.
SEHH2238 Computer Networking Tutorial 8 Page 3
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com