NWC203c - PE - SE23
NWC203c - PE - SE23
NWC203c - PE - SE23
acknowledged service. How do the protocols that provide these services different?
Answer:
• Connectionless:
o Connectionless service sends a single data unit for each transmission, without establishing
a connection first.
o Each unit contains the necessary protocols for delivery, but does not have any provision
for sequencing or flow control.
• Acknowledged:
o This is achieved by using ACK and NAK control messages to confirm or reject the received
data units.
o These types of protocols are suitable for network communication, where higher layers are
sensitive to loss and the underlying networks have a high probability of error.
• Unacknowledged:
o This is a simpler and faster version that provides service to networks that are either
reliable or can tolerate loss of information, or to higher layers that have built-in error control/recovery
features.
o This does not use any control messages to acknowledge or reject the received data units.
Answer:
• Connection-oriented:
o In this type of service, the sender and the receiver initiate a setup phase to establish a context for
transferring the information.
o This service requires a stateful protocol, which is used to keep track of sequence numbers and
timers.
• Connectionless:
o In this type of service, there is no prior context established for transferring the information between
the sender and the receiver.
o The sender passes its SDU to an underlying layer without any notification.
o The protocols are very different in these services. This service does not require transmitting
protocols to track the acknowledgment of PDU.
o After receiving the PDU, the receiver has to send an acknowledgment. If it is not received in time,
then it will report a failure.
Câu 3: Explain the differences between PPP and HDLC.
Answer:
• The protocol known as HDLC, or High-level Data Link Control, encapsulates data. Point-to-Point Protocol, or PPP for
short, is a protocol that can be used by various devices without modifying the data format.
o PPP only uses a byte-oriented protocol for point-to-point links, whereas HDLC uses a bit-oriented protocol
for point-to-point and multipoint link channels.
o PPP supports encapsulation for both synchronous and asynchronous media, whereas HDLC only supports
encapsulation for synchronous media.
o PPP is compatible with a wider range of devices than HDLC, which is only compatible with Cisco hardware.
Câu 4: A 1.5 Mbps communications link is to use HDLC to transmit information to the moon. What
is the smallest possible frame size that allows continuous transmission? The distance between earth and
the moon is approximately 375,000 km, and the speed of light is 3 x 108 meters/second.
Answer:
For continous transmission: use Go-Back-N or Selective Repeat ARQ
N × nf 2t ¿ × R
= 2t ¿ n f = (*)
R N
In which, n f is Possible Frame Size (bits), Mbps is the number of Megabyte Per Second.
Go-Back-N: 2 ,5 ×1 , 5 ×10
6
If N = 127: ≈ 29527 (bits)
6 127
2 ,5 ×1 , 5 ×10
If N = 7: ≈ 535714 ( bits )
7 Selective repeat:
6 6
2 ,5 ×1 , 5 ×10 2 ,5 ×1 , 5 ×10
If N = 4: =937500 (bits) If N = 64: ≈ 58594 (bits)
4 64
Câu 5: Suppose HDLC is used over a 1.5 Mbps geostationary satellite link. Suppose that 250-byte
frames are used in the data link control. What is the maximum rate at which information can be
transmitted over the link?
Answer:
R = 1.5 Mbps or R = 1.5 ×10 Mbps, and n f = 250 bytes or 2000 bits (250 × 8)
6
The distance that the information must trravle is the earth-to-satellite distance, or D ≈ 36,000 km
= 3,6 x 107 m
The speed of light c is 3 x 108 . We can calculate the propagation delay and processing rate as
follows:
7
3 ,6 × 10
2t ¿ = 8 = 0,12s = 120 ms
3× 10
nf 2000
tf= = = 0,00133s = 1,33 ms
R 1, 5 ×106
We can use either Go-Back-N or Selective Repeat ARQ. The default window size is N = 7 ( with a 3-bit
sequence number).
The maximum information rate is achieved with no error, and hence, no retransmission.
In which, n is number of bits transmitted in a cycle, Rmax is number of bits sent in a cycle / minimum cycle time.
If the extended sequence numbering option (7-bit) is used, the maximum send window size would be N =27 -1 = 127,
and hence, the maximum information rate is:
Câu 6: Suppose that a multiplexer receives constant-length packet from N = 60 data sources. Each
data source has a probability p = 0.1 of having a packet in a given T-second period. Suppose that
the multiplexer has one line in which it can transmit eight packets every T seconds. It also has a
second line where it directs any packets that cannot be transmitted in the first line in a T-second
period. Find the average number of packets that are transmitted on the first line and the average
number of packets that are transmitted in the second line.
Answer:
Firstly, we find out the probability of the k packets that have reached the T-second. It can be
computed with the help of binomial distribution that has parameters as N = 60 and shows the
probability of p = 0.1
The average number for the arrivals of the packets can be given as Np = 6. Now, calculate the
average number of packets received through the first line as below:
8
Avg=∑ k ( 0.1 ) 0.960 k =4.59
k
k=0
Now, the average number of packets received is 4.59 that gets transmited through the first line.
The remaining will get transmitted by the second line. Now, the average number of packets
transmitted through the second line per T second can be obtained as below:
Therefore, it will transmit 1.41 packets on average per T second from the second line.
Câu 7: Consider the transfer of a single real-time telephone voice signal across a packet
network. Suppose that each voice sample should not be delayed by more than 20 ms.
a. Discuss which of the following adaptation functions are relevant to meeting the
requirements of this transfer: handling of arbitrary message size; reliability and
sequencing; pacing and flow control; timing; addressing; and privacy, integrity and
authentication.
b. Compare a hop-by-hop approach to an end-to-end approach to meeting the requirements
of the voice signal
Answer:
a. Message size is crucial because real-time voice communications need the delivery of a fixed packet
size that can only accommodate speech signals of 20 milliseconds or less. As long as the required
speech packet size can be handled, it is not as crucial how arbitrary message sizes are handled.
Sequencing is crucial as every packet must arrive in the order that it was produced. While voice
transmission can withstand a certain amount of error and loss, reliability is only somewhat critical.
Pacing and flow control are less significant because it is assumed that the end systems' speeds will
be same by virtue of the voice signal's synchronous nature.
Timing, for real-time voice transfer is crucial since it assists in reducing the jitter of the supplied
signal through its adaption function.
Addressing is just when the connection is being set up, assuming some kind of virtual circuit packet
switching technique.
Privacy, integrity, and authentication have typically not been as significant as the previously
mentioned issues.
b. When the underlying network is reliable, processing at the edge is sufficient to deliver
acceptable performance because the probability of error is very low. The hop-by-hop method may
be required if the underlying network is unreliable. For instance, error recovery at each hop may
be necessary if the probability of error is very high, as it is in a wireless channel, to enable effective
communication.
Câu 8 : Consider the Stop-and-Wait protocol as described. Suppose that the protocol is modified so that
each time a frame is found in error at either the sender or receiver, the last transmitted frame is immediately
resent.
Answer:
a. In the stop-and-wait protocol described in the chapter, the sender retransmits a frame if it does
not receive an acknowledgement within a certain time. The modified protocol retransmits a frame
whenever the sender or receiver detects an error. The only difference is that the retransmission
happens earlier. Therefore, the protocol works correctly.
Câu 9: 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?
Answer:
a. To transmit messages of any size, the messages need to be divided into segments that are M-H bytes long
and sent in multiple PDUs. Messages that are small enough can be sent in a single PDU.
b. The peer processes have to share information that enables the receiver to reassemble the messages. For
instance, the first PDU may include the length of the message. The last PDU may have a marker to indicate
the end of the message. Sequence numbers may also help to detect loss in connection-oriented networks
and to assist in reconstructing the messages in connectionless networks. Moreover, since PDUs can have
different sizes, the size of each PDU has to be included in the PDU header.
c. In this case, besides all the header information mentioned in b, each PDU must have a stream ID, so that
the receiver can handle each stream separately when reassembling messages
Câu 10:A 1 Mbyte file is to be transmitted over a 1 Mbps communication line that has a bit error rate of p =
10-6.
a. What is the probability that the entire file is transmitted without errors? Note for n large and p
very small, (1 − p)n ≈ e-np.
b. The file is broken up into N equal-sized blocks that are transmitted separately. What is the
probability that all the blocks arrive correctly without error? Does dividing the file into
blocks help?
c. Suppose the propagation delay is negligible, explain how Stop-and-Wait ARQ can help deliver the
file in error-free form. On the average how long does it take to deliver the file if the ARQ
transmits the entire file each time?
Answer:
a. The file length n = 8 x 106 bits, the transmission rate R = 1 Mbps, and p = 10−6
P[no error in the entire file] = (1− p)n ≈ e−np , for n >> 1, p << 1 = e−8 = 3.35 x 10−4
We conclude that it is extremely unlikely that the file will arrive error free.
Here , n f = n >> n a thus t 0 ≈ t f = n/R ; and Pf =1−P [no error ] = 1−¿ e−np
−np
E[total] = n/R(1 - pf ¿=n /[ℜ ] = 8 / (3.35 x 10-4) = 23,847 seconds = 6,62
hours
The file gets through, but only after many retransmissions.
Câu 11:
In this activity, you are given the network address of 192.168.1.0/24 to subnet
and provide the IP addressing for the Packet Tracer network. Each LAN in the
network requires at least 25 addresses for end devices, the switch and the
router. The connection between R1 to R2 will require an IP address for each end
of the link.
Answer:
a. Based on the topology, we need 4 subnets – one for each LAN andn one for the link
between R1 and R2
b. To support 4 subnets, we need to borrow two bits from the host portion of the IP
address. This is because 22=4
c. Borrowing two bits creates four subnets: 192.168.1.0/26,
192.168.1.64/26,192.168.1.128/26, and 192.168.1.192/26
d. Each subnet has 62 usable host addresses. This is because a /26 subnet provides 64
total addresses, but two of those are reserved for the network and broadcast
addresses, leaving 62 usable addresses per subnet.
a.
We saw that S1,S2,S3,S4, S0/0/0 are the subnets needed, so that there is 5 subnets
are needed
b. We call N is the number of bits, then N is the smallest number that satisifes
4 ×2 N −2≥ 25
Then we got N = 3
c. We saw that number of bits N = 3, then the number of subnets does this create is
3
2 =8
d. 28−n−2=28−3−2=30
Câu 12: Five stations (S1-S5) are connected to an extended LAN through transparent bridges
(B1- B2), as shown in the following figure. Initially, the forwarding tables are empty. Suppose
the following stations transmit frames: S1 transmits to S5, S3 transmit to S2, S4 transmits to S3,
S2 transmits to S1, and S5 transmits to S4. Fill in the forwarding tables with appropriate entries
after the frames have been completely transmitted.
Solution:
B1
Address Port Explaination
Because there is S1 sent. So B1 will receive
Step 1 S1 => S5 S1 1
this packet
Since S3 sends the broadcast, B1 receives
Step 2 S3 => S2 S3 2 it.
Because after step 2, B2 knows that S3 is
on port 2, it will forward the packet to port
Step 3 S4 => S3 S4 2 2. And of course, both S3 and port 2 of B1
will also receive it.
Since S2 sends the broadcast, B1 receives
Step 4 S2 => S1 S2 1 it.
B2 already knows that S4 is on network 3,
so B2 will no longer forward the packet to
Step 5 S5 => S4
networks 2 and 1. So this step B1 won't say
where S5 is
B2
Address Port Explaination
Because in the beginning, there is S1
sending S5. But both B1 and B2 do not
know where S5 is, so the packet that S1
Step 1 S1 => S5 S1 1 sends is a broadcast. B1 will also forward
the packet because it doesn't know where
S5 is => B2 will receive it and know that S1
is on port 1
Because there is a session sending S3 to S2,
but since S3 doesn't know where S2 is
Step 2 S3 => S2 S3 1 initially, it sends it as a broadcast. And so,
B2 can also receive the packet of S3, so B2
can also understand that S3 is on its port 1.
Step 3 S4 => S3 S4 2 Because S4 sent to S3
After step 1, B1 already knows that S1 is
on network 1, so it will not forward the
Step 4 S2 => S1
packet anymore. So at this step, B2
doesn't know where S2 is.
Step 5 S5 => S4 S5 2 Because S5 sends a broadcast
a. Use the Dijkstra algorithm to find the set of shortest paths from node 4 to other
nodes.
b. Find the set of associated routing table entries (Destination, NextHop,Cost)
Solution:
a.
Iteration N D1 D2 D3 D5 D6
Initial {4} (−1 , ∞) (−1 , ∞ ) (−1 , ∞ ) (−1 , ∞ ) (−1 , ∞)
1 {4,2} (5,4 (1,4) (2,4) (3,4) (−1 , ∞)
)
2 {4,2,3} (4,2 _____ (2,4) (3,4) (−1 , ∞)
)
3 {4,2,3,5} (4,2 _____ _____ (3,4) (3,3)
)
5 {4,2,4,5,6} (4,2 _____ _____ _____ (3,3)
)
6 {4,2,3,5,6,1} (4,2 _____ _____ _____ _____
)
B.
D1 4 D2
D2 1 D2
D3 2 D3
D5 3 D5
D6 3 D3
Câu 14:
You are a network technician assigned to install a new network for a customer. You must
create multiple subnets out of the 192.168.1.0/24 network address space to meet the
following requirements:
- The first subnet is the LAN-A network. You need a minimum of 50 host IP
addresses.
- The second subnet is the LAN-B network. You need a minimum of 40 host IP
addresses.
- You also need at least two additional unused subnets for future network
expansion.
Note: Variable length subnet masks will not be used. All of the device subnet masks should
be the same length.
Answer the following questions to help create a subnetting scheme that meets the stated
network requirements:
a. How many host addresses are needed in the largest required subnet?
b. What is the minimum number of subnets required?
c. The network that you are tasked to subnet is 192.168.1.0/24. What is the /24 subnet
mask in binary?
d. The subnet mask is made up of two portions, the network portion, and the host portion.
This is represented in the binary by the ones and the zeros in the subnet mask.In the
network mask, what do the ones and zeros represent?
e. When you have determined which subnet mask meets all of the stated network requirements,
derive each of the subnets. List the subnets from first to last in the table. Remember that the
first subnet is 192.168.0.0 with the chosen subnet mask.
Solution:
Câu 15: Suppose that Selective Repeat ARQ is modified so that ACK messages contain a list of the next
m frames that it expects to receive.
Q.16. (2 marks)
a. How long does it take to download the file over a 32 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?
Solution:
c. (Đề kêu 1:6 thì chỉ việc nhân thêm cho 6 ở chỗ tốc độ là xong, nếu trường ra đề 1:10 thì nhân 10)
T(32k) = (1 x 1024 x 1024 x 8)/(32 x 1000 x 6) = 43.69 (second) nếu bằng 10 26843.5464
T(1M) = (1 x 1024 x 1024 x 8)/(1 x 1000 x 1000 x 6) = 1.4 (second) nếu bằng 10 858993.4592
Q.17 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
Solution:
1010
1011 1001000
1011
01000
1011
00110
Codeword = 1001110
Q.18. (2 marks)
135.46.56.0/22 Interface 0
135.46.60.0/22 Interface 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?
Solution:
a. If a packet with an IP address of 135.46.63.10 arrives, the router will forward the packet to Interface 1. This is
because the destination address falls within the range of the CIDR entry 135.46.60.0/22, which has a longer
prefix than the other matching CIDR entry for the destination address
b. If a packet with an IP address of 135.46.57.14 arrives, the router will forward the packet to Interface 0. This is
because the destination address falls within the range of the CIDR entry 135.46.56.0/22, which has a longer
prefix than the other matching CIDR entry for the destination address.
In general, when a packet arrives at a router, the router looks up the destination IP address in its routing table
to determine where to forward the packet. The router selects the route with the longest matching prefix (i.e.,
the most specific entry), known as the "most-specific match," to determine the next hop for the packet. If
there are multiple matching entries with the same prefix length, the router uses the entry with the lowest
administrative distance, which is a value assigned by the router to indicate how trustworthy the route is. If no
matching routes are found in the routing table, the router forwards the packet to the default route, which is
typically the gateway to an external network such as the internet.
Câu 19:
Corporation A:
Mask: 255.255.252.0
For a packet to be routed to an organization, the first 23 bits of the IP address must match because of the mask of
255.255.252.0. A. All packets with an IP address in the range of 198.16.0.0 to 198.16.39.255 will be forwarded to
organization A because the first 23 bits of the IP address 198.16.0.0 match the first 23 bits of the subnet mask
255.255.252.0
Corporation B:
Mask: 255.255.254.0
The first 22 bits of the IP address must match for the packet to be routed to organization B, according to the mask of
255.255.254.0. All packets with an IP address in the range of 198.16.40.0 to 198.16.63.255 will be forwarded to
organization B because the first 22 bits of the IP address 198.16.40.0 match the first 22 bits of the subnet mask
255.255.254.0
Corporation C:
Mask: 255.255.252.0
The first 23 bits of the IP address must match for the packet to be routed to organization C, according to the mask of
255.255.252.0. All packets with an IP address in the range of 198.16.64.0 to 198.16.95.255 will be forwarded to
organization C because the first 23 bits of the IP address 198.16.64.0 match the first 23 bits of the subnet mask
255.255.252.0
Corporation D:
Mask: 255.255.255.0
For a packet to be routed to organization D, all 32 bits of the IP address must match, as indicated by the mask of
255.255.255.0. All packets with an IP address in the range of 198.16.96.0 to 198.16.127.255 will be forwarded to
organization D because the first 32 bits of the IP address 198.16.96.0 match the first 32 bits of the subnet mask
255.255.255.0
Câu 20:
(2 marks) 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 = 100 bytes, 500 bytes, 1000 bytes.
Solution:
TCP/IP over Ethernet allows data frames with a payload size up to 1460 bytes. Therefore, L = 100, 500 and 1000
bytes are within this limit.
Therefore:
Câu 21:(2 marks) 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
Solution:
a) 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 acknowledgment segment from B, A will find out that B received a wrong sequence
number. A will discard the acknowledgment packet and reset the connection by sending a new SYN segment
b) 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.
Q22(2 marks) Suppose a header consists of four 16-bit words: (11111111 11111111, 11111111
00000000, 11110000 11110000, 11000000 11000000). Find the Internet checksum for this code.
Solution:
b 0 = 11111111 11111111 = 216−1=65535
b 1 = 11111111 00000000 = 65280
b 2 = 11110000 11110000 = 61680
b 3 = 11000000 11000000 = 49344
x=b 0 +b1 +b 2+ b3 modulo 65535→ 241839 modulo 65535=45234
b 4=−x modulo 65535=20301
So the Internet checksum = 01001111 01001101
Q23. Consider the 7-bit generator, G=10011, , and suppose that D has the value 1001010101. What is the
value of R? Show your all steps to have result.
Solution:
Given data:
G=10011
D=1001010101
The polynomial expression of G:
= x 4 ×1+ x 3 × 0+ x 2 × 0+ x 1 × 1+ x 0 ×1
= x 4 + x 1 +1
Here, the degree of the expression is 4. So, r = 4
Thus, D+r becomes 10010101010000
Now dividing D + r with G the value of R is:
10010101010000 10011
⊕ 1000110000
10011
-------
000011010
⊕
10011
-------
010011
⊕
10011
-------
000000000 => Now we get the remain is : 0000
So the value of R is 0000.
Q24. Suppose two hosts, A and B, are separated by 20,000 kilometers and are connected by a direct link of R = 2
Mbps. Suppose the propagation speed over the link is 2.5 x 108 meters/sec.
Solution:
a)The distance (Distance) between two hosts A and B = 20,000 km = 2 ×107 meters(since 1 km=103 )
Transmission rate (R) of the direct link between A and B = 2 Mbps = 2 ×106 Mbps ( 1 Mbps=10 6 bps )
Propagation Speed(S) of the link between A and B = 2.5 ×10 8 meters/ sec
7
Distance 2 ×10
Calculate the propagation delay: d prog= = 8
=0.08 second
Speed 2.5 ×10
6 4
Calculate the band-width delay product: R ×d prog =2× 10 ×0.08=16 ×10 bits
b)
Size of the file =800000 bits = 8 ×10 5 bits
Trasmission rate(R) of the direct link between A and B =2Mbps = 2 ×106 bps ( 1 Mbps=106 bps )
6 4
The band-width delay product: R ×d prog =2× 10 ×0.08=16 ×10 bits
Therefore, the maximum number of bits at a given time will be 160000bits
Câu 26. (optional question) Sender A wants to send 100111010011011 to receiver B. This transmission uses
CRC algorithm for error detection with generator polynomial bits string is 10111. What is bits string will be
transmitted on the medium. Show your all steps to have result.