CS176A - Introduction to Computer
Communication Networks
Homework Assignment #3 Solutions
1. When would ALOHA do better (in terms of throughput) than Slotted ALOHA? And when would the opposite be true?
Basically ALOHA does better when the load is light, while slotted ALOHA does better under heavier loads.
2. Briefly mention the difference between Link State routing and Distance Vector routing. Give an example of a protocol for each type of routing.
One basic difference is that in LS routing, each node has to know the cost of each link on the network, and when ever that cost changes, the new link cost must be sent to ALL nodes. On the other hand, in DV routing, messages are exchanged between directly connected neighbors only at each iteration. Therefore the time of convergence is longer in DV than in LS routing. Examples: LS: OSFP, DV: RIP.
3. What is CIDR? Why did a need arise for it (Give a scenario that would clarify this need)?
CIDR is Classless Inter Domain Routing. The basic need for it came when we were starting to run out of class A and B addresses, and companies would need several Class C addresses for the same company. This way we could minimize the entries in the routing tables so that we could group a number of addresses together, rather than having an entry for each one.
Any scenario that has some sort of address grouping is appropriate: (the following is an example, any other is accepted)
A company needs 4 class C addresses, and it gets the following: 201.15.0/24, 201.15.1/24, 201.15.2/24 and 201.15.3/24 so instead of having these four entries in every routing table, when they all belong to the same company, then they could be grouped to: 201.15.0/22 .
4. What is DHCP? When would it be a good idea to use it? And when would it be a bad idea?
Dynamic Host Configuration Protocol. Good Idea: for purposes of ease of configuration (do not need to set the IP, Netmask, Gateway, DNS on each machine that joins the network), also for using a few number of IP's dynamically to serve a large number of machines (compared to the number of IPs). Bad Idea: if we know that users are going to be mobile most of the times, you cannot have connections sustained while moving from one network to another. Another case where it would be not be good idea to use, is when you know that machines are going to be stable, and the probability of all of them being used at the same time is pretty high (like in CSIL lab for instance).
5. Give a scenario where you would need to use a DHCP server and a NAT box at home. In other words, when would you need both of them at your home?
Both of them could be used at home basically if I have several computer at home that I need to connect to the Internet, but only one IP is provided to me, and I also know that I might buy new machines and don't know how to or want to configure all the network related information on each machine. This way, you would need a NAT at home so that it would do this one IP to many address translation so that all the machines would be connected to the internet in parallel, and the same box, (or one attached to it) a DHCP server would basically do that dynamic assigning of the IPs to the machines in my house so that I don't bother myself with all the details of machine configuration.
6. We know the function of the “Type” field in the Ethernet header, which field in the IP header has a similar function? What is the function of these fields in IP and the Data Link layers?
Type: to know which network protocol in the Network layer it should hand the packet to after stripping off the Ethernet header. The field that does a similar function in IP is the Protocol field, and is used to know which protocol to pass the packet to (after stripping off the IP header) in the transport layer.
7. Run the simulation applet on the web page: http://www.rad.com/networks/1998/packet/sim.htm. Run both the virtual circuit and datagram configurations.
a. What benefit do you see to using Datagram Switching?
The main advantage is adapting to congestion by making each packet take the path that best suits it.
b. What benefit do you see to using Virtual Circuit Switching?
The main advantage or benefit is that packets arrive in order.
Note to TA: Any other benefits that are logical are accpetable.
8. If UCSB is allocated the range of addresses 128.111/16 and they want to divide it into 8 equal groups of addresses, what exactly would the new ranges of addresses be? In other words, I am looking for 8 address entries in the CIDR format, each representing one of the eight networks.
128.111.0/19, 128.111.32/19, 128.111.64/19, 128.111.96/19, 128.111.128/19, 128.111.160/19, 128.111.192/19, 128.111.224/19
9. Run the simulation of RIP available on the web page: http://www-mm.informatik.uni-mannheim.de/veranstaltungen/animation/routing/ripdvmrp/ Run the Demo (Edit -> Run Demo).
Starts with 2 nodes, adds 3 more to become a total of five.
Because the cost would be higher if it goes through node 4, and the packets are supposed to take the least cost path.
Yes there is. Because the link between nodes 2 and 5 was down.
Simply increase the weight of the link between nodes 2 and 5, OR decrease weights between nodes 2 to 4 and 4 to 5.
10. When I send a packet over the Internet from node A to B, does the checksum in the IP header packet change or stay the same? Justify your answer.
The checksum changes, simply because the TTL is decremented at each hop, and since the checksum is done on the IP header (which now changed) so it needs to be recomputed each time at each hop.
11. Run a “traceroute” to a host that is at least 20 hops away and include the run with your assignment.
Any trace would be fine.
12. If you were asked to implement “traceroute”, which field in the IP header would you really use to help you implement your program?
TTL.
13. Could you have the DF and MF bits both set to one in the same IP packet? Justify your answer.
Yes. Because a router might decide to fragment a packet (that originally had no DF or MF bits set) but also decide that it doesn't want these fragments to be further fragmented, so it basically sets the DF flag to one to ensure that, and the MF would be set since this current router is fragmenting the original packet.
14. What are the basic differences in services between TCP and UDP?
UDP basically adds only the multiplexing and demultiplexing service, in addition to that, TCP offers: Connections, In Order delivery, Reliability and Congestion Control.
15. Why do we need the Source port and Destination port as part of the header in both TCP and UDP?
You basically need them to be able to multiplex and demultiplex the packets from and to the various applications that are on top of TCP and UDP.