0% found this document useful (0 votes)
69 views17 pages

Pe NWC

The document contains examples of calculating error detection codes using different generating polynomials, shortest path algorithms, IP address lookups in routing tables, bandwidth calculations, checksum calculations, and file transfer times over networks. Specific examples include: - Calculating codewords for information bits 110111 using generating polynomials x+1 and x3 + x2 + 1. - Applying Dijkstra's algorithm to find shortest paths from node u in a graph. - Looking up IP addresses 135.46.63.10 and 135.46.57.14 in a routing table to determine the next hop interface. - Calculating bandwidth-delay product and file transfer time for a 900,000 bit file over a 3 Mbps link between

Uploaded by

quylhhe176826
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)
69 views17 pages

Pe NWC

The document contains examples of calculating error detection codes using different generating polynomials, shortest path algorithms, IP address lookups in routing tables, bandwidth calculations, checksum calculations, and file transfer times over networks. Specific examples include: - Calculating codewords for information bits 110111 using generating polynomials x+1 and x3 + x2 + 1. - Applying Dijkstra's algorithm to find shortest paths from node u in a graph. - Looking up IP addresses 135.46.63.10 and 135.46.57.14 in a routing table to determine the next hop interface. - Calculating bandwidth-delay product and file transfer time for a 900,000 bit file over a 3 Mbps link between

Uploaded by

quylhhe176826
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/ 17

1: 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.
-Data = 110111.
-We have g1(x) = x+1 = x1 + x0 = 11
 generating polynomial = 11.
-We add (n-1) bit 0 to end of the Data bit string ( with n is the length
of the generating polynomial bit string)
-we have : 1101110.
-Take the bit string that can be divided modulus 2 by the generating
polynomial bit string.
1 1 0 1 1 1 0 11
1 1 100101
0 0 0 1 1
1 1
0 0 10
11
0 1  FCS
 The bit string to be transmitted is: 11011101
B, b. Find the codeword corresponding to these information bits if
g2(x) is used asthe generating polynomial.
- Data: 110111.
-we have g2(x) = x3 + x2 + 1 = x3 + x2 + 0*x1 + x0 =1101
 generating polynomial = 1101
- add (n-1) bit 0 to the end of the Data bit string (with n is the length
of the generating polynomial).
-we have : 110111000.
-Take the bit string can be divided modulus 2 by the generating
polynomial bit string.
1 1 0 1 1 1 0 0 0 1101
1101 100010
00001100
1101
0 0 0 1 0  FCS
 The bit string to be transmitted is: 110111010
2. 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.
- We have Data: 1010100001.
- Generating polynomial: 10111.
- Add (n-1) bit 0 to the end Data bit string (with n is the length of
generating polynomial bit string)
- we have : 10101000010000
- Take the bit string can be divided modulus 2 by the generating
polinomial bit string
1 0 1 0 1 0 0 0 0 1 0 0 0 0 10111
10111 1001011001
00010000
10111
0011101
10111
010100
10111
00011000
10111
0 1 1 1 1  FCS
The bit string to be transmitted is: 10101000011111
3, 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.

Using Dijkstra’s algorithm we have table

Vertice u v x w y z
choice.
Step 1 u 0 ~ ~ ~ ~ ~
Step 2 x - 2,u 1,u 5,u ~ ~
Step 3 v - 2,u - 5,u 2,x ~
Step 4 y - - - 5,u 2,x ~
Step 5 w - - - 5,u - 5,y
Step 6 z - - - - - 5,y

4, 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?
-we have IP: 135.46.63.10 subnet mask is /22. It mean the above IP
address reserved 22 bit for the network address part.
 135.46.63.10(10) = 10000111.00101110.00111111.00001010(2)
-The network address take only 22 bit
10000111.00101110.00111100.00000000=135.46.60.0/22
router will forward the packet to interface 1.
(b)What does the router do if a packet with an IP address
135.46.57.14
arrives?
-We have Ip: 135.46.57.14 subnet mark is/22. It mean the above IP
address reserved 22 bit for the network address part.
-we have 57(10) = 111001(2)
135.46.57.14 = 10000111.00101110.00111001.00001110.
-The network address take only 22 bit.
10000111.00101110.00111000.00000000=135.46.56.0/22.
router forward the packet to interface 0.

5, 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.
- A separated by B = 30000 km = 3*107 m
-R = 3 * 106 bit/s
-Propagation speed = 2.5 * 108 m/s
 R _ dprop = 3*107 / 2.5 * 108 = 0.12 s
 bandwidth-delay product = 3 * 106 * 0.12 = 360000 bit
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?
- file have 900000 bits  we will have to split the data into many
packet. Each packet has a capacity = 360Kb.
6, Let g(x)=x3+x+1. Consider the information sequence 1011. Find
thecodeword corresponding to the preceding information sequence.
Using polynomial arithmetic we obtain
- Data:1011.
-we have g2(x) = x3 + x + 1 = x3 + 0x2 + x1 + x0 =1011
 generating polynomial = 1011
- add (n-1) bit 0 to the end of the Data bit string (with n is the length
of the generating polynomial).
-we have :1011000.
-Take the bit string can be divided modulus 2 by the generating
polynomial bit string.
1 0 1 1 0 0 0 1011
1011 1000
0 0 0 0 0 0 0  FCS
The bit string to be transmitted is: 1011000
7. 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-beingtransmitted packet have been
transmitted, and n packets are already in the queue?
-Packets size = 8*2500 bits.
-Rate = 3*106 bit/s
-Transmitted 1250 bytes , remaining : (4*2500+2500-1250) * 8 = 9
* 104 bits
 the queuing delay for the packet is: 9 * 104 / 3*106 = 0.03 s
- With packets size = L , transmission rate is R, x bits of the
currently-beingtransmitted packet have been transmitted, and n
packets are already in the queue.
- We have General formula for calculating the queuing delay for the
packet is: (L * n + (L – x)) / R
8. Suppose a header consists of four 16-bit words: (11111111
11111110, 11111111 00000000, 11110000 11110000, 11000000
11000001). Find the Internet checksum for this code
Cách 1:
We have:
11111111 11111110
11111111 00000000
11110000 11110000
11000000 11000001
11 10110000 10101111 = 10110000 10101111 + 11 =
10110000 10110010
Internet checksum = 01001111 01001101
Cách 2:
b0 = 11111111 11111111 = 216 – 1 = 65535
b1 = 11111111 00000000 = 65280
b2 = 11110000 11110000 = 61680
b3 = 11000000 11000000 = 49344
x = b0 + b1 + b2 + b3 modulo 65535 = 241839 modulo 65535 =
45234
b4 = −x modulo 65535 = 20301
So the Internet checksum = 01001111 01001101

9. 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?
-Length = 2000 bytes.
-Distance = 3.5 * 106 m
- Propagation speed = 2.5 * 108 m/s
- Transmission rate = 2 Mbps
- Transmission delay = L/R
= 8 bits/byte * 2,000 bytes / 2,000,000 bps
= 8 ms
Propagation delay = d/s

= 3.5 * 106 / 2.5 * 108


= 14 ms
Therefore, the total time = 14ms + 8ms = 22 ms
b. Does this propagation delay depend on the packet length? No
c. Does this propagation delay depend on the transmission rate? No

10, 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?
R1 = 250 kbps
R2 = 3 Mbps
R3 = 2 Mbps
a. Throughput
- Bandwidth (Băng thông): Độ rộng của đường truyền tin. (Khoảng
chênh lệch giữa thành phần tần số thấp nhất tới thành phần tần số
cao nhất trong 1 tín hiệu = Hz) => Khả năng truyền đc nhiều dữ liệu
tại 1 thời điểm là càng lớn. Đo bằng bit/s
- Tốc độ truyền (Transimission Rate): Là tốc độ truyền được bao
nhiêu bit /s. Đo cũng bằng bit/s
- Thông lượng (Throughput): Là số lượng bit hữu ích truyền đi trong
1 s. bit/s. Luôn nhớ: thông lượng <= tốc độ truyền
a.
Throughput = min(R1,R2,R3)
Throughput = 250kbps
b. File size: 32 * 106 / 250 * 103 = 128 s

11, 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
TCP/IP over Ethernet allows data frames with a payload size up to
1460 bytes. Therefore, L = 100, 500 bytes 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,52% efficiency (1).
L = 1000 bytes, 1000/1058 = 94.518% efficiency (1).
-We have 2000>1460 --> must split into 2 data frames
L = 2000 bytes, 2000/2116 = 94,518% efficiency (1).
12, . 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?
T35k = 8 (1024) (1024) / 35000 = 239.675 seconds
b. How long does it take to take to download the file over a 1
megabit/second modem?
T1M = 8 (1024) (1024) / 106 = 8.388 seconds
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:
T35k = 8 (1024) (1024) / (35000 x 6) = 39.946 sec
T1M = 8 (1024) (1024) / (1x106 x 6) = 1.398 sec
13, 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.
- In a three-way handshake procedure, one must ensure the
selection of the initial sequence number is always unique. If station
B receives an old SYN segment from A, B will acknowledge the
request based on the old sequence number. When A receives the
acknowledge segment from B, A will find out that B received a
wrong sequence number. A will discard the acknowledgement
packet and reset the connection.
(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?
-) If an old SYN segment from A arrives at B, followed by an old ACK
segment from A to a SYN segment from B, the connection will also
be rejected. Initially, when B receives an old SYN segment, B will
send a SYN segment with its own distinct sequence number set by
itself. If B receives the old ACK from A, B will notify A that the
connection is invalid since the old ACK sequence number does not
match the sequence number previously defined by B. Therefore, the
connection is rejected.
14, 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.
-Data = 100111010011110. -Generating polynomial = 10110.
-We add (n-1) bit 0 to end of the Data bit string ( with n is the length
of the generating polynomial bit string)
-we have : 1001110100111100000.
-Take the bit string that can be divided modulus 2 by the generating
polynomial bit string.
1 0 0 1 1 1 0 1 0 0 1 1 1 1 0 0 0 0 0 10110
10110 101000010100010
0010110
10110
0000010011
10110
0010111
10110
000010000
10110
0 0 1 1 0 0  FCS
 The bit string to be transmitted is: 1001110100111101100
15: Suppose that two peer-to-peer processes provide a service that
involves the transfer of discrete messages. Suppose that the peer
processes are allowed to exchange PDUs that have a maximum size
of M bytes including H bytes of header. Suppose that a PDU is not
allowed to carry information from more than one message.
a. Develop an approach that allows the peer processes to exchange
messages of arbitrary size.
b. What essential control information needs to be exchanged
between the peer processes?
c. Now suppose that the message transfer service provided by the
peer processes is shared by several message source-destination
pairs. Is additional control information required, and if so, where
should it be placed?
a) To convert arbitrary sizes, large contents must be split into bytes
of each length that will be transmitted in multiple PDUs.

b) Peer-to-peer processes move information allowing messages to


be aggregated.

c) A PDU must be attached to the sequence ID, to process each


sequence independently when a message is selected. This stream ID
can be dodged if the source and target work for them to process a
content transfer at a certain time.
16, Suppose that a group of computers is connected to an Ethernet LAN. If the
computers communicate only with each other, does it make sense to use IP
protocol in the computers? Should the computers run TCP directly over
Ethernet? How is addressing handled?

IP convention can be utilized since the IP convention is a lot of necessities for


tending to also as directing information on the Internet. Since the computer
can't run principles-based TCP without IP, TCP uses IP addresses. There is a
need to utilize an individual custom streaming convention. that depends on
Ethernet or another link layer as a lower layer.

17, (1) The figures below show the TCP/UDP communication pattern
diagrams. Which diagram works for TCP? Why?

(2) Fill the missing steps (blank boxes) in both diagrams for TCP/UDP
correspondingly.

1) Diagram (b) will work for TCP since it is a network protocol that shows the
details of how data is sent as well as received.

2) Missing steps : (a) bind, connect , (b) bind>listen>accept, connect.

18, A university has 150 LANs with 100 hosts in each LAN.

(a) Suppose the university has one Class B address. Design an appropriate
subnet addressing scheme.

(b) Design an appropriate CIDR addressing scheme.

a) Class B's address has 14 bits for the network ID and 16 bits for the host ID.
We need to decide how many bits to allocate to the subnet id versus the host
id for designing an appropriate subnet addressing scheme. We can choose
either 7 bits or 8 bits to identify the hosts.

b) The CIDR addressing scheme involves generating a prefix length that


indicates the length of the network mask.

You might also like