Sunteți pe pagina 1din 3

Computer Networks 159.

334
Answers Tutorial No. 5
Professor Richard Harris
Question 1
An IPv4 datagram has arrived with the following information in the header (in hexadecimal
notation)
0x45 00 00 54 00 03 58 50 20 06 00 00 7C 4E 03 02 B4 0E 0F 02
a) Is the packet corrupted?
b) Are there any options?
c) Is the packet fragmented?
d) What is the size of the data?
e) How many more routers can the packet travel to?
f) What is the identification number of the packet?
g) What is the type of service?

Answer

Let us first find the value of header fields before answering the questions:

VER = 0x4 = 4
HLEN =0x5 = 5 5 4 = 20 bytes
Service =0x00 = 0 (Normal/routine)
Total Length = 0x0054 = 84 bytes
Identification = 0x0003 = 3
Flags and Fragmentation = 0x5850 D = 1 M= 0 offset = 6224
Time to live = 0x20 = 32
Protocol = 0x06 = 6
Checksum = 0x0000??
Source Address: 0x7C4E0302 = 124.78.3.2
Destination Address: 0xB40E0F02 = 180.14.15.2
We can then answer the questions:

a. If we see the checksum, we get 0x0000. The packet is likely to be corrupted.


b. Since the length of the header is 20 bytes, there are no options.
c. Since D = 1 and M = 0 and offset = 6224, the packet is not permitted to be fragmented.
d. The total length is 84. Data size is 64 bytes (8420 = 64 bytes).
e. Since the value of time to live = 32, the packet may visit up to 32 more routers.
f. The identification number of the packet is 3.
g. The type of service is normal.

Note: This question comes from Forouzan in Chapter 20. I suspect that the
fragment/offset and checksum fields were swapped in the construction of the question
and that the true checksum is probably 0x5850 and the fragment/offset field should
have been 0x00 00. The answers would be more appropriate in that case. Viz: Packet
not corrupted and that packet is not fragmented.

Question 2
Find the error, if any, in the following IP addresses:
a) 111.56.045.78
b) 221.34.7.8.20
c) 75.45.301.14
d) 11100010.23.14.67

Answer
a) No leading zero permitted for 045
b) Too many dots!
c) Can’t have 301 as 255 is the largest!
d) Mixed binary and dotted notation

Question 3
Convert the following IP addresses to binary and indicate their class:
a) 111.56.45.78
b) 221.34.7.82

Answer
a) IP Address format summary
Hex: 6f382d4e
Octal: 15716026516
Decimal: 1865952590
Binary: 01101111 00111000 00101101 01001110
IP Address: 111.56.45.78
IP Class is: Class A
Default mask: /8
b) IP Address format summary
Hex: dd220752
Octal: 33510403522
Decimal: 3709994834
Binary: 11011101 00100010 00000111 01010010
IP Address: 221.34.7.82
IP Class is: Class C
Default mask: /24

S-ar putea să vă placă și