Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
The unit of HLEN is 32 bits (4 bytes). If the HLEN value is 7, the header is 28 bytes in length. The
base header (not including the option field) is 20 bytes. So we have 8 bytes of options.
3. An IPv4 packet has arrived with the first few hexadecimal digits as shown.
45 00 00 28
00 01 00 00
01 02 . . .
How many hops can this packet travel before being dropped? The data belong to what upper-
layer protocol?
Each digit is 4 bits. I’ve re-arranged the digits to match each row of the header. The packet has
a TTL=1. The protocol field has value 02, which corresponds to IGMP
(https://en.wikipedia.org/wiki/List_of_IP_protocol_numbers)
4. In an IPv4 datagram, the M bit is zero, the value of HLEN is 5, the value of total length is 200, and
the offset value is 200. What is the number of the first byte and the number of the last byte in the
datagram? Is this the last fragment, the first fragment or a middle fragment?
Data size is Total Length – Header Length = 200- (4x5) = 180 bytes. Recall that the HLEN is unit
of 4 bytes.
The offset field has value 200. This number is in units of 8 bytes. So the actual offset is 1600
bytes.
The number of last byte is 1600+180-1 = 1779
5. An IPv4 datagram has arrived with the following information in the header (in hexadecimal):
45 00 00 84
02 03 78 00
11 06 50 11
2B 3E 0F 01
A2 1E 03 03.
4 5 0 0
0 0 8 4
0 2 0 3
7 8 0 0
1 1 0 6
2 B 3 E
0 F 0 1
A 2 1 E
+ 0 3 0 3
1 A F E D
Add the 1 to the sum, we get 0xAFEE. Take the 1s-complement (XOR the sum with 0xFFFF),
we get 0x5011. This matches the value in the checksum field. It is not corrupted.
6. Draw a flow chart of the steps involved when a router receives a distance vector
message from a neighbor. Assume all link cost is 1.
Answer
No
Add entry to Table Destination
Network in Table?
Yes
No
Yes No
Does Rc offer a lower cost
route to destination?
7. router Ra has the following routing table (assume each link cost is 1)
Net2 4
Net4 3
Net7 3
Assume all link cost is one. Only Net1 needs to be updated; Net1 3 Rc
(i) N2 5 Rc,
(ii) Net7 4 Rc
8. Consider a router with the following routing table. If an IP address 130.130.16.207
arrives, what is the outgoing port?
9. Consider the following network topology. Describe how the count-to-infinity problem
occurs if nodes use the Bellman-Ford routing protocol. All links have a cost of 1.
A B C D
At time t, node-B and C have the following routing table for node-A. (A, A, 1), and ( A, B, 2)
(destination, next-hop, cost).
Assume that at time t+1, link A—B dies, and causes node-B to delete its route entry A—A—1.
Shortly after, node-C sends a route update which contains (A, 2); i.e., (destination, cost). As a
result, node-B adds this ‘new’ route entry to its table; i.e., (A, C, 3). It accepts this route
because node-B does not know that node-C’s next-hop to A is node-B itself.
Node B then sends a route update containing (A, 3). This is received by node-C, which then
updates its route entry to (A, B, 4). In its next route update, it’ll have (A, 4). Node-B will in turn
update its route entry to (A, 5). The process is repeated and you’ll see that the cost to node-A
slowly counts to infinity.
The reason why this occurs is because nodes do not inform their neighbors the next-hop route
which they used for a given destination.
Link state protocols do not have this problem as every node has a complete map of the
topology, and hence node-B will know that node-C does not have an ‘alternative’ route to
node-A.
10. Using the Dijkstra Algorithm, compute the shortest path tree from node-1.
1 4
2 3
2
3 1
5
2
4 6
5
7
8
4
7
Describe the process which routers use to build a network topology – e.g., how do routers in the
above figure learn the network topology?
1,5,2,3,6,4,7 4 6 9 3 7 11
4 2 3
1 1
2
3 5
6
5 4 4