0% found this document useful (0 votes)
4 views21 pages

NWC

Uploaded by

mingquang2019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views21 pages

NWC

Uploaded by

mingquang2019
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

1.

Suppose two hosts, A and B, are separated by 30,000 kilometers and are
connected by a direct link of R = 3 Mbps. Suppose the propagation speed over
the link is 2.5 x 108 meters/sec.
a. Calculate the bandwidth-delay product, R _ dprop.
b. Consider sending a file of 900,000 bits from Host A to Host B. Suppose the
file is sent continuously as one large message. What is the maximum number
of bits that will be in the link at any given time?

2. Let g(x)=x3+x+1. Consider the information sequence 1001. Find the


codeword corresponding to the preceding information sequence. Using
polynomial arithmetic we obtain
3. A packet switch receives a packet and determines the outbound link to
which the packet should be forwarded. When the packet arrives, one other
packet is halfway done being transmitted on this outbound link and four
other packets are waiting to be transmitted. Packets are transmitted in order
of arrival.
Suppose all packets are 2,500 bytes and the link rate is 3 Mbps. What is the
queuing delay for the packet? More generally, what is the queuing delay when
all packets have length L, the transmission rate is R, x bits of the currently-
being transmitted packet have been transmitted, and n packets are already in
the queue?
4. Suppose a header consists of four 16-bit words: (11111111 11111110,
11111111 00000000, 11110000 11110000, 11000000 11000001). Find the
Internet checksum for this code
Solution:
(4)
Given,
=>16-bit words
=>Four 16-bit words = (11111111 11111110, 11111111 00000000, 11110000
11110000, 11000000 11000001)
Explaination:
Calculating internet checksum:
Step 1:
=>Summing all the four 16-bit words
=>Summation = 1111111111111110 + 1111111100000000 + 1111000011110000
+ 1100000011000001
=>Summation = 111011000010101111
Step 2:
=>Summation contains 18 bits so wrapping around extra 2 bits
=>Wrapped summation = 1011000010101111 + 11
=>Wrapped summation = 1011000010110010
Step 3:
=>Taking the 1's complement of wrapped summation
=>Internet checksum = 1's complement of wrapped summation
=>Internet checksum = 1's complement of 1011000010110010
=>Internet checksum = 0100111101001101
=>Internet checksum = 01001111 01001101
I have explained each and every part with the help of statements attached to
the answer above.
5. Consider a packet of length 2,000 bytes that propagates over a link of
distance 3,500 km with propagation speed of 2,5 · 108 m/s, and transmission
rate
2 Mbps?
a. How long does the packet propagation take?
b. Does this propagation delay depend on the packet length?
c. Does this propagation delay depend on the transmission rate?
Bổ sung câu a
6. A router has the following CIDR entries in its routing table: Address/mask
Next hop
135.46.56.0/22 Interface 0
135.46.60.0/22 Interface 1
192.53.40.0 /23 Router 1
default Router 2
(a) What does the router do if a packet with an IP address 135.46.63.10
arrives?
(b)What does the router do if a packet with an IP address 135.46.57.14
arrives?
Consider the following entries in the routing table :
135.46.56.0/22
135.46.60.0/22
192.53.40.0/23
Format is Address/Mask
So /Mask determines number of bits of 1's in subnet mask.
Let us find the subnet mask in octet representation :
For /22, the first 22 bits will be 1 followed by 0
So
11111111.11111111.11111100.00000000
which is 255.255.252.0
For /23, the first 23 bits will be 1 followed by 0
So
11111111.11111111.11111110.00000000
which is 255.255.254.0
So our routing table now looks like :
Address Mask Next Hop

135.46.56.0 255.255.252.0 Interface 0

135.46.60.0 255.255.252.0 Interface 1

192.53.40.0 255.255.254.0 Router 1

Default 0.0.0.0 (default subnet mask) Router 2

part a.
IP address arrives at the router 135.46.63.10.
We have to determine as per the routing table where the router forwards this
packet to.
So we perform ANDing of this IP address with the subnet masks in the table.
If there is a match with the address in the table, the packet is forwarded to the
next hop in the table.
In case of multiple match, the packet is forwarded to the next hop having the
longest subnet mask.
In case of no match, follow the default route.
So performing
135.46.63.10 AND 255.255.252.0
we have :
10000111.00101110.00111111.00001010
11111111.11111111.11111100.00000000
____________________________________________________
10000111.00101110.00111100.00000000
____________________________________________________
which is : 135.46.60.0
It does not match the first row of the routing table but matches with the
second row of the routing table.
But we have to check by ANDing with the third row subnet mask as well.
So performing
135.46.63.10 AND 255.255.254.0
we have :
10000111.00101110.00111111.00001010
11111111.11111111.11111110.00000000
____________________________________________________
10000111.00101110.00111110.00000000
____________________________________________________
which is : 135.46.62.0
But this does not match will the third row in the routing table.
Only match found is : Row 2 which is 135.46.60.0
Hence the packet is forwarded to Interface 1
part b.
IP address arrives at the router 135.46.57.14
So firstly,
135.46.57.14 AND 255.255.252.0, we have :
10000111.00101110.00111001.00001110
11111111.11111111.11111100.00000000
____________________________________________________
10000111.00101110.00111000.00000000
____________________________________________________
which is : 135.46.56.0 (Matches with first row)
Now check with subnet mask 255.255.254.0
135.46.57.14 AND 255.255.254.0, we have :
10000111.00101110.00111001.00001110
11111111.11111111.11111110.00000000
____________________________________________________
10000111.00101110.00111000.00000000
____________________________________________________
which is : 135.46.56.0 (It is not matching with third row)
So the only match is first row.
Hence packet is forwarded to Interface 0
7.Suppose Host A wants to send a large file to Host B. The path from Host
A to Host B has three links, of rates R1 = 250 kbps, R2 = 3 Mbps, and R3 = 2
Mbps.
a. Assuming no other traffic in the network, what is the throughput for the file
transfer?
b. Suppose the file is 4 million bytes. Dividing the file size by the throughput,
roughly how long will it take to transfer the file to Host B?
Ans : (a) Throughput is limited by the minimum of capacity of the
links .Here , minimum is R1.So throughput is 250 kbps.
(b) Dividing the size of the file by the throughput tohet approximate time to
transfer to host B :-
t = (4 × 1000000 × 8 )/ (250 × 1000 ). { 1mb = 8 million bit }
=128 sec.
8. Suppose an application layer entity wants to send an L-byte message to its
peer process, using an existing TCP connection. The TCP segment consists of
the message plus 20 bytes of header. The segment is encapsulated into an IP
packet that has an additional 20 bytes of header. The IP packet in turn goes
inside an Ethernet frame that has 18 bytes of header and trailer. What
percentage of the transmitted bits in the physical layer correspond to message
information, if L = 200 bytes, 1000 bytes, 2000 bytes
The IP packet in turn goes inside an Ethernet frame that has 18 bytes of
header and trailer.
The packet in turn goes inside an Ethernet frame that has 18 bytes of header
and trailer.
TCP/IP over Ethernet allows data frames with a payload size up to 1460
bytes.
Therefore, L = 200, 1000 are within this limit.
The message overhead includes:
TCP: 20 bytes of header
IP: 20 bytes of header
Ethernet: total 18 bytes of header and trailer.
Therefore
L = 200 bytes, 200/258 = 77.5% efficiency.
L = 1000 bytes, 1000/1058 = 94.5% efficiency.

9. Suppose the size of an uncompressed text file is 1 megabyte


a. How long does it take to download the file over a 35 kilobit/second modem?
b. How long does it take to take to download the file over a 1 megabit/second
modem?
c. Suppose data compression is applied to the text file. How much do the
transmission times in parts (a) and (b) change?
If we assume a maximum compression ratio of 1:6, then we have the following
times for the 35 kilobit and 1 megabit lines respectively:
Cách 1 :
Cách 2 :

10. Consider the three-way handshake in TCP connection setup.


(a) Suppose that an old SYN segment from station A arrives at station
B, requesting a TCP connection. Explain how the three-way handshake
procedure ensures that the connection is rejected.
(b) Now suppose that an old SYN segment from station A arrives at station
B, followed a bit later by an old ACK segment from A to a SYN segment from
B. Is this connection request also rejected?
In three-way handshake, there are three messages transmitted by TCP to
establish connection between computer.
1. SYN: Client sets the segment sequence number to a random value (say X)
and send SYN message to server.
2. SYN-ACK: Server sends SYN-ACK in response to client. Set
acknowledgment number to one more than the recieved sequence number
(X+1) and sequence number of the packet to another random value (say Y)
3. ACK- Finally, Client sends an ACK back to the server and set sequence
number to the recieved acknowledgment number (X+1) and acknowledgment
number to one more than recieved sequence number (Y+1).
In this process, one must ensure that first sequence number(i.e. X) is always
unique.
Now, if station B recieves an old SYN segment from station A, station B will
acknowledge request based on old sequence number and send
acknowledgment to station A by adding one more to the recieved old sequence
number. A will find out that B had recieved wrong sequence number. Hence,
A will discard the acknowledgment and reject the connection.
Yes, the connection will get rejected if an old SYN segment from station A
arrives at station B followed a bit later by an old ACK segment from A to a
SYN segment from B. Initially when B recieves an old SYN segment from A, B
will send a SYN segment with its own unique sequence number. Now, if B
recieves an old ACK from A, B will identify that the old ACK sequence
number doesnot match with the sequence number send by B previously and
notify A that the connection is invalid. That is why the connection will be
rejected.
11. Sender A wants to send 100111010011110 to receiver B. This transmission
uses CRC algorithm for error detection with generator polynomial bits string
is 10110. What is bits string will be transmitted on the medium. Show your all
steps to have result.
12. Consider the following network Figure 1. With the indicated link costs, use
Dijkstra’s shortest-path algorithm to compute the shortest path from u to all
network nodes. Show how the algorithm works by computing a table.

5
3
2 v w 5
u 24 z

14
x3
1y
Figure 1
13.Let g1(x) = x + 1 and let g2(x) = x3 + x2 + 1. Consider the information bits
(1,1,0,1,1,1).
a. Find the codeword corresponding to these information bits if g1(x) is used
as the generating polynomial.
b. Find the codeword corresponding to these information bits if g2(x) is
usedas the generating polynomial.
14.Consider the 7-bit generator, G=10111, and suppose that D has the value
1010100001. What is the value of R? Show your all steps to have result.
Given,
G=10111
D=1010100001
when writing G in polynomial form, the highest power is 4
so r=4
adding 4 extra bits at the end of D = 10101000010000
After dividing D with G we get remainder 1111
so, r = 1111

You might also like