Docsity

EE122 HW2 Solution - EECS Instructional Support, Schemes and Mind Maps of Communication

Toggle sidebar
bg1
Homework Assignment #2
Due Sept 30 4pm
EE122: Introduction to Communication Networks (Fall 09)
EECS, University of California, Berkeley
Submit solution to bSpace. Accepted formats: txt, pdf and ps
1. Kisco Inc. is a startup making Internet equipments. You are hired to
design and implement an IPv4 router.
a. Which header fields must be updated before the router sends out
a packet?
TTL and checksum
b. Your router needs to add a 4-byte option to some IPv4 packets,
which header fields (include your answer to question a) need to be
updated?
TTL, checksum, header length, total length and option
c. You find that the router prototype doesn't read or write time-to-
live field. What would happen? What is the right way to deal with
time-to-live field?
A packet may be forwarded forever.
A router should decrement TTL by 1, drop the packet if it's 0, and
return ICMP message "Time exceeded"
d. To lower the hardware cost, you decide to ignore header
checksum, so your router doesn't check or update it. You also test 3
interconnected router prototypes in your lab, without finding any
problem. So is this a good idea? Why or why not?
No.
1. packet may be corrupted in real Internet
2. routers from other vendors will drop the packet because checksum
is wrong
e. To accelerate packet forwarding, you decide to read the last 4
bytes in the header as destination IP address. But it occasionally fails
to get the right address. Why? How would you solve the problem?
Packets may have options in the header. So the last 4 bytes is
option, not destination address.
pf3
pf4

Partial preview of the text

Download EE122 HW2 Solution - EECS Instructional Support and more Schemes and Mind Maps Communication in PDF only on Docsity!

Homework Assignment

Due Sept 30 4pm

EE122: Introduction to Communication Networks (Fall 09)

EECS, University of California, Berkeley

Submit solution to bSpace. Accepted formats: txt, pdf and ps

  1. Kisco Inc. is a startup making Internet equipments. You are hired to design and implement an IPv4 router.

a. Which header fields must be updated before the router sends out a packet? TTL and checksum

b. Your router needs to add a 4-byte option to some IPv4 packets, which header fields (include your answer to question a) need to be updated? TTL, checksum, header length, total length and option

c. You find that the router prototype doesn't read or write time-to- live field. What would happen? What is the right way to deal with time-to-live field? A packet may be forwarded forever. A router should decrement TTL by 1, drop the packet if it's 0, and return ICMP message "Time exceeded"

d. To lower the hardware cost, you decide to ignore header checksum, so your router doesn't check or update it. You also test 3 interconnected router prototypes in your lab, without finding any problem. So is this a good idea? Why or why not? No.

  1. packet may be corrupted in real Internet
  2. routers from other vendors will drop the packet because checksum is wrong

e. To accelerate packet forwarding, you decide to read the last 4 bytes in the header as destination IP address. But it occasionally fails to get the right address. Why? How would you solve the problem? Packets may have options in the header. So the last 4 bytes is option, not destination address.

Use the absolute offset, 17th to 20th bytes are destination IP address. Or check header length field, and only use last 4 bytes if header is 20 bytes.

f. What's the minimum length of IPv4 header? If you have 1MB data to send but each IPv4 packet can only be 40 bytes. How many bytes you actually send at IP layer (assume no transport layer header)? 20 bytes. 2M bytes.

g. You find the 10th byte of an IPv4 packet is 0x06. What do you know about the packet? It's a TCP packet

  1. After you finish the router prototype, you need to test it with different packet switching technologies, which may have different MTU. In a test, your router has 3 links with MTU as below:

link Maximum Transmission Unit (bytes)

1 60

2 420

3 1000

a. The router receives a 600-byte IPv4 packet from link 3, and it needs to send it to link 2. What will happen? Which header fields need to be updated? The router needs to split the packet into smaller ones. Total length, flag, fragmentat offset, TTL and checksum.

b. If the 600-byte IPv4 packet from link 3 has 20 bytes header, at least how many packets need to be sent over link 2? Write down the value of total length, flag and fragmentation offset fields of each outgoing packet. at least 2 packets. total length flag offset packet 1: 420 1 0 packet 2: 200 0 50 Note: other answers are also right if

  1. the sum of total length is 580+20*number of packets
  2. packet i+1 offset = (packet i length - 20)/8 + packet i offset
  3. packet 1 has offset 0
  4. flag is 1 except the last packet, which has 0

10.1.1.12, will B get the packet? Why or why not?

No. Because they are in different private networks, and packet must have a public IP address to be forwarded on Internet.

d. A customer uses 192.168.1.0/24 for private network, but 300 computers need Internet access (but not at the same time). Which protocol will you suggest the customer use to assign IP addresses? Why? DHCP. Because one IP address can be assigned to different hosts if they do not access Internet at the same time.