Docsity

Cheat Sheet for computer networks, Cheat Sheet of Computer Networks

Toggle sidebar
bg1
1.Given an IP datagram with the fragmentation offset of 00000010110102, HLEN of 516 and the total
length of 007A16, find the numbers of the first byte and the last byte of data in this datagram
In binary, given fragmentation offset: 0000001011010 0000001011010
Converting it to decimal: 90 90 (not 184 184 as previously calculated)
Let us now recalculate the first byte of data:
Fragmentation Offset 8 + Header Size = First Byte of Data
Data First Byte=Fragmentation Offset8+Header Size
First Data Byte = 90 8 + 20
First Data Byte=908+20
First Data Byte = 720 + 20 = 740 bytes
First Data Byte=720+20=740 bytes
To find the last byte of data, do the following:
Last Byte of Data = First Byte of Data + ( Total Header Size ) 1
Last Data Byte=First Data Byte+(Total LengthHeader Size)1
Last Byte of Data = 740 + ( 122 20 ) 1
Last Data Byte=740+(12220)1
Last Data Byte = 740 + 102 1 = 841 bytes
Last Data Byte=740+1021=841 bytes
2Consider fragmenting an original IP datagram whose total size is 600010 bytes with a base header only. The
offset of the second fragment is 9816 . Answer the following questions: (6 points)
How many fragments are there? Give the data range for each of them. (Assume that all the fragments except the
last one are equal.) (3 points)
What is the total size of each fragment? (2 points)
What is the fragmentation offset of the last fragment?
a. There are 600 fragments (6000 / 10). Each fragment's data range is 0 to 97, 98 to 195,..., 588 to 599.
Number of fragments = total size/frame size = 6000/10
b. Each fragment has a total size of 10 bytes. d. The latest fragment's fragmentation offset is 5880 bytes.
c. The last fragment's fragmentation offset: total size-fragment size = 6000-10
3.The first few hexadecimal digits of an IP datagram are as follows: 4E00 00B4 0034 408F. Find the
total length, the header length, and the data size. Is there the next fragment? Can this datagram be
fragmented?
An IP datagram's hexadecimal representation often comprises information about the fields in the IP header. Let's
dissect the given hex values:
4E00 00B4 0034 408F in hexadecimal: 4E00 00B4 0034 408F
Total Length: The IP header's total length field is 16 bits (2 bytes) long and shows the total size of the IP
datagram (header + data).
Total Length = 4E00 (in hex) = 19968 (in decimal) bytes.
Header Length: This 4-bit parameter specifies the size of the IP header in 32-bit words.
Header Length = (4E00 >> 12) & 0xF = 4 words (in decimal).
The actual length of the header is 4 * 4 = 16 bytes.
Size of the data:
Total length minus header length equals 19968 - 16 = 19952 bytes.
Following Fragment:Is it possible to fragment this datagram?
The IP header's "Don't Fragment" (DF) flag indicates whether the datagram can be further fragmented.
The DF flag set to 1 indicates "Do not fragment."
If the DF flag is set to 0, the datagram is fragmentable.
In this scenario, the DF flag in the Flags field must be examined to see whether the datagram can be fractured.
Because the "Don't Fragment" flag is not set (DF = 0), this datagram can be further fragmented if necessary.
4.An IP packet with HLEN = E16 carries 254010 bytes of data. What is the size of the “Options”?
What is the value (in the hexadecimal format) of the “Total length” field?
The IP header length (HLEN) field determines how many 32-bit words are in the IP header. The IP
header's Total Length field shows the total size of the IP packet, including both the header and the
payload.
pf3
pf4
pf5

Partial preview of the text

Download Cheat Sheet for computer networks and more Cheat Sheet Computer Networks in PDF only on Docsity!

1 .Given an IP datagram with the fragmentation offset of 0000001011010 2 , HLEN of 5 16 and the total

length of 007A 16 , find the numbers of the first byte and the last byte of data in this datagram In binary, given fragmentation offset: 0000001011010 0000001011010 Converting it to decimal: 90 90 (not 184 184 as previously calculated) Let us now recalculate the first byte of data: Fragmentation Offset 8 + Header Size = First Byte of Data Data First Byte=Fragmentation Offset8+Header Size First Data Byte = 90 8 + 20 First Data Byte=908+ First Data Byte = 720 + 20 = 740 bytes First Data Byte=720+20=740 bytes To find the last byte of data, do the following: Last Byte of Data = First Byte of Data + ( Total Header Size ) 1 Last Data Byte=First Data Byte+(Total LengthHeader Size) Last Byte of Data = 740 + ( 122 20 ) 1 Last Data Byte=740+(12220) Last Data Byte = 740 + 102 1 = 841 bytes Last Data Byte=740+1021=841 bytes

2 Consider fragmenting an original IP datagram whose total size is 600010 bytes with a base header only. The

offset of the second fragment is 9816. Answer the following questions: (6 points) How many fragments are there? Give the data range for each of them. (Assume that all the fragments except the last one are equal.) (3 points) What is the total size of each fragment? (2 points) What is the fragmentation offset of the last fragment? a. There are 600 fragments (6000 / 10). Each fragment's data range is 0 to 97, 98 to 195,..., 588 to 599. Number of fragments = total size/frame size = 6000/ b. Each fragment has a total size of 10 bytes. d. The latest fragment's fragmentation offset is 5880 bytes. c. The last fragment's fragmentation offset: total size-fragment size = 6000-

3. The first few hexadecimal digits of an IP datagram are as follows: 4E00 00B4 0034 408F. Find the

total length, the header length, and the data size. Is there the next fragment? Can this datagram be fragmented? An IP datagram's hexadecimal representation often comprises information about the fields in the IP header. Let's dissect the given hex values: 4E00 00B4 0034 408F in hexadecimal: 4E00 00B4 0034 408F Total Length: The IP header's total length field is 16 bits (2 bytes) long and shows the total size of the IP datagram (header + data). Total Length = 4E00 (in hex) = 19968 (in decimal) bytes. Header Length: This 4-bit parameter specifies the size of the IP header in 32-bit words. Header Length = (4E00 >> 12) & 0xF = 4 words (in decimal). The actual length of the header is 4 * 4 = 16 bytes. Size of the data: Total length minus header length equals 19968 - 16 = 19952 bytes. Following Fragment:Is it possible to fragment this datagram? The IP header's "Don't Fragment" (DF) flag indicates whether the datagram can be further fragmented. The DF flag set to 1 indicates "Do not fragment." If the DF flag is set to 0, the datagram is fragmentable. In this scenario, the DF flag in the Flags field must be examined to see whether the datagram can be fractured. Because the "Don't Fragment" flag is not set (DF = 0), this datagram can be further fragmented if necessary.

4 .An IP packet with HLEN = E16 carries 254010 bytes of data. What is the size of the “ Options”?

What is the value (in the hexadecimal format) of the “ Total length” field? The IP header length (HLEN) field determines how many 32-bit words are in the IP header. The IP header's Total Length field shows the total size of the IP packet, including both the header and the payload.

Given: HLEN = E16 (or 14 in decimal). 2540 bytes of data Let's do the math: Header Dimensions: Header Dimensions = HLEN * 4 bytes 14 * 4 = 56 bytes for the header Size of Options: Size of Options = Header Size - Minimum Header Size If no parameters are specified, the minimum header size is 20 bytes. Size of options = 56 - 20 = 36 bytes Length in total: Total Length = Header Length + Data Length Total bytes = 56 + 2540 = 2596 Let us now express the Total Length in hexadecimal form: Total Length = 2596₁₀ = A24₁₆

5. An original IP datagram, that carries (3470)10 bytes of data and has only the base header, was

fragmented. The first fragment contains bytes from 0 to 399. All the fragments except the last one are equal. What is the total overhead (in bytes) needed to send all the data of the original datagram to the destination? Given: The original data size was 3470 bytes. Data range for the first fragment: 0 to 399 bytes All fragments (save the final) are the same size. Let's do the math: The IP header is the following size: Assume the standard IP header size is 20 bytes. Each fragment (save the last one) is the following size: Data range for the first fragment: 0 to 399 bytes Size of fragment = 400 bytes (399 + 1) The number of fragments is: The number of fragments is equal to the ceiling (Original data size / Fragment size). Number of fragments = 3470 / 400 = 9 fragments Overhead total: Total overhead = (fragment count - 1) * IP header length Overhead total = (9 - 1) × 20 = 8 * 20 = 160 bytes As a result, the total overhead required to deliver all of the original datagram's data to the destination is 160 bytes. 6. An IP packet has arrived with a “ D” bit value of 0, an “ M” bit value of 0, and a fragmentation offset value of zero. Is this packet the first fragment, the last fragment, the middle fragment, or the only fragment? "D" bit = 0 "M" bit = 0 Offset of fragmentation = 0 This value combination suggests the following: The "D" bit is set to zero, indicating that the packet can be fragmented. The "M" bit is set to 0: This indicates that there are no further fragments; it is the final fragment. The fragmentation offset is set to 0: This specifies where the fragment is in relation to the original datagram. An offset of 0 indicates that this is the initial piece. As a result of these values, the packet is the first and last component. The "M" bit in this case indicates that it is the lone fragment in this case.

  1. A header of a UDP datagram is (in the hexadecimal format): 0315 C43B 00B3 001C(give your answers in the decimal format) (4 points)
  1. The following TCP header dump is given in the hexadecimal format: CB5A00D3 00B 00003021 50100EB4 00500000 (give your answers in the decimal format). (6 points) ● What are the source and destination port numbers? ● What is the sequence number? ● What is the acknowledgment number? ● What is the header length? ● Which flags are set? ● What is the window size? TCP Header: CB5A00D300B412340000302150100EB a. Source and Destination Port Numbers: Source Port: CB5A (in hexadecimal) = 52026 (in decimal) Destination Port: 00D3 (in hexadecimal) = 211 (in decimal) b. Sequence Number: Sequence Number: 00B41234 (in hexadecimal) = 11800516 (in decimal) c. Acknowledgment Number: Acknowledgment Number: 00003021 (in hexadecimal) = 12321 (in decimal) d. Header Length: The header length is determined by the Data Offset field, which is the first 4 bits of the TCP header. Data Offset: 5 (in hexadecimal) = 5 * 4 = 20 bytes e. Flags: The Flags field is represented by the next 12 bits in the TCP header. Flags: 5010 (in hexadecimal) = 20496 (in decimal) The commonly used flags are:URG: 0ACK: 1PSH: 0RST: 0SYN: 1FIN: 0 f. Window Size: Window Size: 0EB4 (in hexadecimal) = 3764 (in decimal)

1 1. A TCP client-server connection was established with the initial sequence number of 100310. The

client sent 500 10 bytes of data in the first segment. What is the sequence number of this segment and the range of the transferred bytes? What is the sequence number of the second segment sent by this client?

The first segment's sequence number is 1003, and the range is 1003 to 1502. The

second segment's sequence number is 1503.

12.The current cwnd =12 and rwnd =26. The last acknowledgment received is 430. Draw the diagram showing this TCP window. A new TCP segment has just arrived with an acknowledgment number of 433 and rwnd=x. What is the minimum value of x to avoid shrinking the window?

Min x = current rwnd -(N ACK-L ACK)

13. Is the size of the ARP packet fixed? Explain you answer

Fixed

What destination address is used in the Ethernet frame carrying an ARP request? Explain your answer.

The broadcast MAC address is represented as FF:FF:FF:FF:FF:FF