You are on page 1of 5

In The Name of God, The Merciful, The Compassionate

Mini-Exam#2
Computer Networks1, Department of Computer Engineering, Sharif University of
Technology, Fall 2012 CE40443
Total Points: 100 / Time: 1:30 hours

___________________________________________________________
1) IP addressing - 11 + 12 Points
(a) Based on the following information, fill the table.
1
2
3
4
5
6
7
8
9
10
11
12
13
14

Host IP Address
Network Mask
Subnet Mask
Network Address
Network Broadcast Address
Number of Subnet Bits
Number of Subnets
Number of Host Bits per Subnet
Number of Usable Hosts per Subnet
Subnet address of this IP address
Broadcast address of this subnet
IP Address of First Host on this Subnet
IP Address of Last Host on this Subnet
The maximum number of subnets for this subnet mask

172.25.114.250
255.255.0.0 (/16)
255.255.255.192 (/26)
172.25.0.0
172.25.255.255
10 bits
210 = 1024 subnets
6 bits
26 - 2 = 64 - 2 = 62 hosts per subnet
172.25.114.192
172.25.114.255
172.25.114.193
172.25.114.254
16 subnets (/27 to /30)

(b) Consider the network shown below, consisting of a single router, R1, with three subnets A, B
and C, with 15, 12, and 45 hosts respectively on these subnets. Assign an address range from
129.19.40.0/23 to the hosts in subnets A, B, and C so that only a single aggregated address needs
to be advertised by R1 to the public Internet, and that the size of the advertised aggregated
address range is minimized. What is the single aggregated network that is advertised? In a
sentence or two, explain how you arrived at your answer.

http://ce.sharif.edu/courses/91-92/1/ce443-1/index.php

Answer: Subnet A requires at least 4 bits of addressing, subnet B requires at least 4 bits of
addressing, and subnet C requires at least 6 bits of addressing.
Let the first 3 bytes of the address for all of the hosts be X.Y.Z.
The address for hosts in subnet C are in the range X.Y.Z.00CCCCCC, where the last byte of
the address begins with two 0s and the rest of the 6 bits are used to address hosts in C. Note
that the second bit in the last byte is a 0. For subnets A and B, this bit will be a 1.
The address for hosts in subnet B are in the range X.Y.Z.010BBBBB. The last byte of the
address begins with 010 and the final 5 bits can be used to address the hosts in B.
The address for hosts in subnet A are in the range X.Y.Z.011AAAAA. The last byte of the
address begins with 011 (which differs from the leading 010 for subnet B, and the leading 00
for subnet C) and the final 5 bits can be used to address the hosts in A.
The size of the single aggregated network that is advertised is thus X.Y.Z.0/25the last seven
bits are used to address hosts in subnets A, B, and C.
2) Routing - 5 + 20 Points
(a) Compare and contrast distance vector routing protocols versus link-state protocols.
Answer:
Distance vector
Routing Information Protocol (RIP), based on Bellman-Ford algorithm
Each neighbor periodically exchange reachability information to its neighbors
Minimal communication overhead, but it takes long to converge, i.e., in proportion to the
maximum path length
Link state
Open Shortest Path First (OSPF), based on Dijkstras algorithm
Each router periodically floods immediate reachability information to other routers
Fast convergence, but high communication and computation overhead
____________________________________________________
(b) Consider the network shown below. Using the distance-vector algorithm, calculate the
distance vectors at node D at each time slot until there are no more distance-vector updates
exchanged among routers. Assume that the nodes only know their distances to their direct
neighbors initially.

Answer:

____________________________________________________
3) Cyclic Redundancy Check (5 Points) - Assume that the sender and the receiver agree on a 4bit generator pattern, G, which is equal to 1001. The sender wants to send to the receiver 6 bits of
data, D, which is equal to 101110. Find the CRC bits R to be appended to D.
Answer: See Fig 5.8 in the textbook. R = 011
_____________________________________________________
4) Link Layer Addressing (10 Points) - Consider the network depicted in the figure below. The
IP addresses and MAC addresses of individual interfaces are as denoted in the figure.

Suppose that the sender host with the IP address 111.111.111.111 wants to send an IP datagram
to the receiver host with IP address 222.222.222.222. Answer the following questions. Justify
your answers.
(a) What is the destination IP address of the datagram when it leaves the sender host?
Answer: 222.222.222.222
(b) What is the destination IP address of the datagram when it leaves the router?
Answer: 222.222.222.222
(c) What is the destination MAC address of the frame when it leaves the sender host?
Answer: E6-E9-00-17-BB-4B
3

(d) What is the destination MAC address of the frame when it leaves the router?
Answer: 49-BD-D2-C7-56-2A
(e) Which protocol is used to determine the destination MAC address?
Answer: ARP protocol is used.
_____________________________________________________
5) Carrier sense and collision detection (11 Points). Consider two nodes A and B on the same
Ethernet segment, and suppose the propagation delay between the two nodes is 225 bit times.
Suppose at time both nodes A and B begin to transmit a frame.
(a) At what time do they detect the collision?
Both nodes A and B detect the collision at time t=225.
(b) Assuming both nodes transmit a 48-bit jam signal after detecting a collision, at what time (in
bit times) do nodes A and B sense an idle channel?
At time t = 225 + 48 = 273 both nodes stop transmitting their jam signals. The last bit of the jam
signal from B arrives at A at time t = 273 + 225 = 498 bit times. Similarly, the last bit of the jam
signal from B arrives at A at time t = 273 + 225 = 498 bit times.
(c) How many seconds is this for a 10Mbps Ethernet?
For a 10 Mbps Ethernet, this corresponds to (498 bits)/(107 bits/sec) = 49.8 microseconds.
_____________________________________________________
6) Hub, Switch and Router (10 + 4 + 6 Points)
(a) Describe Broadcast and Collision domain and their disadvantages.
Answer: A broadcast domain is a set of NICs for which a broadcast frame sent by one NIC is
received by all other NICs in the same broadcast domain.
A collision domain is a set of network interface cards (NICs) for which a frame sent by one NIC
could result in a collision with a frame sent by any other NIC in the same collision domain.
(b) How can we decrease the broadcast domain in a L2 Switch. Describe your answer.
Answer: VLAN
(c) The Sales (Hub) and Production (L2 Switch) networks are separated by a router as shown in
the diagram below. How many broadcast and collision domains are there in this network. Justify
your answer)

Answer: In this network we have a hub being used in the Sales department, and a switch being
used in the Production department. Based on this, we have two broadcast domains: one for each
network being separated by a router. For the collision domains, we have 5 computers and one
port for E1 so we have 6 collision domains total because we use a switch in the Production
Department so 5 are created there, plus one collision domain for the entire Sales department
because a hub is being used.
4

_____________________________________________________
7) BGP (6 points). Consider the network below in which network W is a customer of ISP A,
network Y is a customer of ISP B, and network X is a customer of both ISPs A and C. For each
answer provide a one-sentence explanation.
(a) What BGP routes will A advertise to X?
(b) What routes will X advertise to A?
(c) What routes will A advertise to C?

Answer:
(a) A will advertise that it can reach w and y, since x needs to know which networks its provider
can reach. It may also advertise that it can reach B and C. However, if B and C are only transit
networks (that is, only providing service to/from their customers networks), then A would not
have to advertise B and C to x.
(b) X will not advertise any routes to A, since otherwise A might try to route through x, and x is
a customer network, not a transit network.
(c) A will advertise that it can reach w and x. Note that since C is a peer network, A will only
advertise its customers to X. In particular, A wouldnt advertise y to C, since that might cause C
to route to y via A.

You might also like