You are on page 1of 34

Câu 1: Explain the difference between connectionless unacknowledged

service and connectionless acknowledged service. How do the protocols that


provide these services differ?
Connection Less: --> > A single free-standing data unit is provided for every
transmission using connectionless service.
-- > Each unit in this has all the protocols required to control the information
needed from a delivery standpoint, but it also lacks any flow control or
sequencing mechanisms.

>> Acknowledged:

-- > ACK and NAK control messages are used to do this.

These kinds of protocols are ideal for network communication, since high
layers in these underlying networks might have a high error rate and are
highly susceptible to loss.

>> Unacknowledge:

This comes in a very simplified version and speeds up communication for


networks that can withstand information loss, are intrinsically trustworthy,
serve a higher layer, or have error control/recovery built in.

A "connectionless service" is a type of network communication that doesn't


establish a dedicated communication channel between the sender and the
recipient.
"Fire and forget," or connectionless unacknowledged service, occurs when a
message is sent without confirmation that the recipient has received it.
There is no confirmation given back to the sender, and the communication
may or may not reach its intended recipient.
On the other hand, with connectionless acknowledged service, the sender
sends a message and then waits for the recipient to confirm receipt. In the
event that the communication is received, the recipient replies with an
acknowledgement to the sender. The sender may presume that the
communication was not received if it does not receive an acknowledgement.
The ways in which these services are provided by the protocols vary in how
they manage protocol overhead and packet loss. User Datagram Protocol
(UDP) and other connectionless unacknowledged service protocols are low
overhead and lightweight, but they do not ensure message delivery. By
providing acknowledgements of successful message delivery, connectionless
acknowledged service protocols like ARP (Address Resolution Protocol) and
ICMP (Internet Control Message Protocol) offer higher reliability despite
having more overhead.
Câu 2. Explain the difference between connection-oriented acknowledged
service and connectionless acknowledged service. How do the protocols that
provide these services differ?
Connection-oriented acknowledged service is a network communication
service that establishes a dedicated connection between the sender and
receiver before any data transmission takes place. Each time a data packet is
received in this service, the recipient replies with an acknowledgement to
the sender.
On the other hand, connectionless acknowledged service transmits data
without first establishing a dedicated connection. Simply put, the sender
sends packets to the recipient, and the recipient replies to the sender with
an acknowledgement for each packet received.
Different protocols handle packet loss and protocol overhead in different
ways when offering these services. Establishing a dependable connection
between the sender and recipient is achieved through a three-way
handshake in connection-oriented acknowledged service protocols like TCP
(Transmission Control Protocol). In order to guarantee effective data transfer
and reduce packet loss, this protocol additionally employs flow control and
congestion control mechanisms. After the data transfer is finished, the
connection is closed.
Protocols for connectionless acknowledged services, like UDP (User
Datagram Protocol), don't create a special connection with the recipient.
Rather, they merely forward the packets to the recipient, making no
guarantees regarding their delivery or order. These protocols are more
beneficial in applications where speed trumps accuracy, like online gaming
and live streaming, because they have less overhead.
To summarize, acknowledged services that are connection-oriented are
dependable but may have higher overhead and be slower, whereas
acknowledged services that are connectionless are quicker but less
dependable and do not ensure packet delivery order.

Câu 3. Explain the differences between PPP and HDLC.


PPP HDLC
Full form Point-to-Point Protocol High-level Data Link
Control
Flexibility PPP is a more flexible protocol than HDLC primarily designed
HDLC. It can be used to carry for carrying only one
multiple network layer protocols, protocol.
including IP, IPX, and AppleTalk.
Error PPP's error detection system is HDLC uses a frame
detection superior. PPP employs the cyclic check sequence (FCS).
redundancy check (CRC) to identify
mistakes. When it comes to
identifying transmission errors, the
CRC is thought to be more efficient.
Configuration PPP configuration is simpler. LCP Manual parameter
configuration is necessary for
(Link Control Protocol), a HDLC, including the address
configuration protocol used by and control fields.
PPP, automates the configuration
process.
Authentication PPP facilitates the use of HDLC does not support
authentication protocols like CHAP any authentication
(Challenge Handshake mechanism.
Authentication Protocol) and PAP
(Password Authentication Protocol),
which verify the sender's identity.
Sliding PPP does not support any silding HDLC uses a sliding
Window window protocol. window protocol for
Protocol flow control. The sliding
window protocol is used
to optimize the flow of
data between the
sender and receiver,
ensuring that the
receiver is not
overwhelmed with too
much data at once.
In conclusion, PPP is a better error detection mechanism than HDLC and is
more flexible and simpler to set up. Furthermore, PPP has features like
authentication that HDLC does not. For flow control, HDLC employs a sliding
window protocol, whereas PPP does not.
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

Maximum Send Window Size in Default Maximum Send Window Size in


HDLC Frame Extended HDLC Frame
Go-Back-N 7 127
Selective Repeat 4 64

D(Distance) = 375,000 km = 375 ×10 6m

c(Speed of Light) = 3 ×10 8m

The round trip propagation delay is:


6
2(375 ×10 m)
2t ¿ = = 2.50s
3 ×108 m/s
We know that:

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.

R = 1,5 Mbps so that R = 1,5 ×10 6 Mbps

Substitute to (*) then we have:

Go-Back-N: 6
2 ,5 ×1 , 5 ×10
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.

t cycle = minimum time to transmit a group of N packets

= t f + 2t ¿ = 1.33 + 2 x 120 = 241.31 ms

In which, t cycleis the minimum time to transmit a group of N packets.

n = no. of bits transmitted in a cycle = N. n f = 7 x 2000 = 14000 bits

no . of bits transmitted∈ a cycle n


Rmax = = = 58 kbps
minimumcycle time t cycle

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:

n = N x n f = 127 x 2000 = 254000 bits


n 254000
Rmax = = = 1052,5 kbps = 1,0525 Mbps
t cycle 241 ,33

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:

The probability of k packets reaching the T-second is calculated using a binomial distribution with
parameters N = 60 and p = 0.1, and the average number of packets received is calculated.
8
Avg=∑ k ( 0.1 ) 0.960 k =4.59
k

k=0

The average number of packets received is 4.59, transmitted through the first line, with the
remaining packets transmitted through the second line per T second.

Y = Np – Avg = 6 – 4.59 = 1.41

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 bcause real-time voice communications require the delivery of a fixed
packet size that can only accommodate speech signals lasting 20 milliseconds or less. How arbitrary
message sizes are handled is not as important as long as the required speech packet size can be
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 the voice signal is synchronous, it is assumed
that the end systems will operate at the same speed
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. Processing at the edge is sufficient to provide acceptable performance when the underlying
network is dependable because the probability of error is very low. If the underlying network is
unreliable, the hop-by-hop approach might be necessary. To enable effective communication, for
example, if the probability of error is high, as it is in a wireless channel, error recovery at each hop
might be required.
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.

a. Show that the protocol still operates correctly.


b. Does the state transition diagram need to be modified to describe the new operation?
c. What is the main effect of introducing the immediate-retransmission feature?

Answer:
a. In the chapter's description of the stop-and-wait protocol, the sender retransmits a frame if it
does not hear back from the recipient within a predetermined window of time. Every time either
the sender or the recipient notices a mistake, the modified protocol retransmits a frame. The
retransmission occurs earlier, which is the only distinction. Consequently, the protocol functions as
intended.

b. No. The state transition diagram remains the same.

c. The error recovery process is faster with this modified protocol.

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. In order for the recipient to put the messages back together, the peer processes must exchange
information. For example, the message's length may be included in the first PDU. There might be a marker
on the final PDU to denote the message's conclusion. In connectionless networks, sequence numbers may
also be useful for message reconstruction and for detecting loss in connection-oriented networks.
Furthermore, each PDU's size must be specified in the PDU header because PDUs can vary in size.

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.

b. A subblock of length n/N is received without error with probaility:

P[no error in subblock] = (1 − p)n/ N

A block has no errors if all subblocks have no errors, so


n
P[no error in block] = P[no errors ∈subblock ] N = ¿ ¿ = (1 − p)

So simply dividing the blocks does not help


c. Refer to the following figure for the discussion
We assume the following:

 t 0= basic time to send a frame and receive the ACK/NAK ≈ ttimeout


 t total = total transmission time until success
 n f ¿ number of bits/ frame
 n a = number of bits per ACK
 nt = number of transmissions
 Pf = probability of frame transmission error
nf na
t 0 = t f +t ACK = + (t ¿≈ 0 ¿ ¿
R R
P [ nt =i ]=P[one success after i− 1 failure] = (1 - pf ¿ p f i −1
Given i transmissions : t total | = i * t 0
∞ ∞
E [ t total ] =∑ it 0 P [ n t=i ] =¿ t 0 (1 − P f ) ∑ i P i− 1 2
f =t 0 ( 1 − P f ) =t 0 (1 – P f )/(1 – Pf ) =t 0 /(
i=1 i=1

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.

a. Based on the topology, how many subnets are needed?


b. How many bits must be borrowed to support the number of subnets in the
topology table?
c. How many subnets does this create?
d. How many usable hosts does this create per subnet?
Answer:

Nếu để bảo là 192.168.1.0/24

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.

Nếu đề bảo là 192.168.100.0/24

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
Step 1 S1 => S5 S1 1 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
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

Câu 13: Consider the network in Figure

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.

Destination Cost Next Hop

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 192 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:

a. The largest required subnet needs 50 host addresses.


b. According to the question, two subnet are required for LAN-A and LAN-B and two
subnets are needed to be left for future use. Therefore the total number of subnets are
4
c. The /24 subnet mask in binary is prefix length
d. In the network mask, the ones represent the network portion and the zeroes represent
the host portion
e.

Subnet Address Prefix Subnet Mask

192.168.12.0 /26 255.255.255.192

192.168.12.64 /26 255.255.255.192

192.168.12.128 /26 255.255.255.192

192.168.12.192 /26 255.255.255.192

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.

Solutions follow questions:

a. How does the protocol need to be modified to accommodate this change?

b. What is the effect of the change on protocol performance?

Solution:
A. 2 things are needed to be changed:-
The frame header needs to be modified to receive the list of frames and Since the reciever
explicitly indicates which frames are needed to be transmitted.
Change in transmitter operation is needed. If the received list contains m oldest frames that are
yet to be received, then it can be used to skip retransmission of frames that have already been
received.
B. Performance will surely increase if the error rate is high or delay is high.
A single frame can ask for the retransmission of several frames.
The complexity of the protocol will surely increase relative to the unchanged Selective repeat
ARQ

Q.16. (2 marks)
Suppose the size of an uncompressed text file is 1 megabyte

Note: Explain your answer in details.

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:

a. (Convert to bits and bits/second)

Size text file = 1 x 1024 x 1024 x 8 (bits)

Speed = 32 x 1000 (bits/second)

 T (32k) = (1 x 1024 x 1024 x 8) / (32 x 1000) = 262.144 (seconds)

b. (Convert to bits and bits/second)

Size text file = 1 x 1024 x 1024 x 8 (bits)

Speed = 1 x 1000 x 1000 (bits/second)

T(1M) = (1 x 1024 x 1024 x 8) / (1 x 1000 x 1000 ) = 8.38 (second)

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

Answer:
g(x)=x3+x+1 -> 1011
the information sequence -> 1001
Add 0 to data bits string. It will be 1001000
Divide 1001000 to 1011. Get the remainder
 110
Codeword: 1001110

Q.18. (2 marks)

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?

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.

Q18. (2 marks)
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?

solution:
Interface 0
Convert to binary
10000111.00101110.001111 00.00000000 (min)

ere are two things needed


to be changes:
The frame header needs to
be modified to receive the
list of frames and Since the
receiver
explicitly indicates which
frames are needed to be
transmitted.
Change in transmitter
operation is needed. If the
recieved list contains m
oldest frames
that are yet to be received,
then it can be used to skip
retransmission of frames
that have
already been received.
b)
Performance will surely
increase if the error rate is
high or delay is high. A
single frame
can ask for the
retransmission of several
frames.
The complexity of the
protocol will surely
increase relative to the
unchanged Selective
repeat ARQ.
There are two things
needed to be changes:
The frame header needs to
be modified to receive the
list of frames and Since the
receiver
explicitly indicates which
frames are needed to be
transmitted.
Change in transmitter
operation is needed. If the
recieved list contains m
oldest frames
that are yet to be received,
then it can be used to skip
retransmission of frames
that have
already been received.
b)
Performance will surely
increase if the error rate is
high or delay is high. A
single frame
can ask for the
retransmission of several
frames.
The complexity of the
protocol will surely
increase relative to the
unchanged Selective
repeat ARQ.
10000111.00101110.001110 11.11111111 (max)

Convert to decimal
(a) Packet with IP address 135.46.63.10 will be forwarded to "Interface 1".
(b) Packet with IP address 135.46.57.14 will be forwarded to "Interface 0".

(ko chep vao) Cách nhận biết:


Xét 135.46.63.10 có 135.46 giống Interface 0 và 1.
135.46.63 lớn hơn Interface 1 thì chọn Interface 1, ngược nếu ví dụ như đề câu b chỉ có
57 (lớn hơn 56 nhưng nhỏ hơn 60) -> chọn Interface 0.
Nếu đề hỏi khác nữa như cho 10.10.10.10 không giống cái nào ở Interface 0, 1 hay Router
1 thì mặc định chọn Default -> Router 2.

Câu 19:

A Large number of consecutive IP address are available starting at 198.16.0.0.


Suppose four organizations, A, B, C, D request 4000, 2000, 4000, and 8000
addresses, respectively. For each of these organizations, give:

1. the first IP address assigned


2. the last IP address assigned
3. the mask in the w.x.y.z/s notation
The start address, the ending address, and the mask are as follows:

Corporation A:

Starting with 198.16.0.0

Last assigned IP address: 198.16.39.255

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:

Address to start: 198.16.40.0

Last assigned IP address: 198.16.63.255

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:

Address to start: 198.16.64.0

Last assigned IP address: 198.16.95.255

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:

Address to start: 198.16.96.0

Last assigned IP address: 198.16.127.255


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.

The message overhead includes:

 TCP: 20 bytes of header


 IP: 20 bytes of header
 Ethernet: total 18 bytes of header and trailer

Therefore:

L = 100 bytes, 100/158 = 63% efficiency (1)

L = 500 bytes, 500/558 = 90% efficiency (1)

L = 1000 bytes, 1000/1058 = 95% efficiency (1)

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) It's important to make sure the first sequence number chosen during a three-way handshake
is always unique. Station B will respond to a request based on the old sequence number if it
receives an old SYN segment from station A. A will discover that B received the incorrect
sequence number when it receives the acknowledgment segment from B. A will send a new SYN
segment to establish a new connection and discard the acknowledgment packet.
b) The connection will also be ignored if an old SYN segment from A reaches B,
followed by an old ACK segment from A to a SYN segment from B. Initially, B
sends a SYN segment with a unique sequence number that it sets on its own when
it receives an old SYN segment. When B receives the old ACK from A, B will
inform A that the connection is not valid because the sequence number in the
outdated ACK differs from the one that B had previously specified. The
connection is thus refused.

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

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

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.

a. Calculate the bandwidth-delay product, R _ dprop.


b. Consider sending a file of 800,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?

Solution:

The distance (Distance) between two hosts A and B = 20,000 km

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

Therefore, band-with delay product is 160000bits

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.

First add 0000 to data bits string. It will be 1001110100110110000.

Next, we divide 1001110100110110000 to 10111 to get remainder.


1001110100110110000 10111

101010001000110
10111
-------
0010010

10111
-------
0010110

10111
-------
000010110

10111
--------
000011100

10111
-------
010110

10111
-------
000010
And here, we have our remainder is 10, but we need 4 bit string so it need to be 0010  FCS is
0010

Câu 3: A bit stream 10011101 is transmitted using the standard CRC method. The generator polynomial
3
is x +¿ 1 . Show the actual bit string transmitted. Suppose the third bit from the left is inverted
during transmission. Show that this error is detected at the receivers end.

Answer:

Generator polynomial

3
x +¿ 1 = 1001
Message transmitted=10011101100

The 3rd bit from left gets inverted. So receiver receives 10111101100

[both sender and receiver agrees on generating polynomial]

non-zero remainder indicates error

CÂU HỎI ÔN TẬP PE NWC203c


Q.1 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
Anwser: Because the message overhead includes – TCP’s header: 20 bytes; IP
packet’s header: 20 bytes and Ethernet frame’s header and trailer: 18 bytes.
Therefore, if
an message consists of L byte length so that the total bytes of that message now is L
+
20 + 20 + 18 = L + 58. The percentage percentage of the transmitted bits in the
physical
layer correspond to message information is p = [L/(L+58)].100. When L = 100
bytes 
p ≈ 63.29%; L = 500 bytes  p ≈ 89.61%; L = 1000 bytes  p ≈ 94.52%
Note: Explain your answer in details
Q2. Suppose the size of an uncompressed text file is 1 megabyte
a. How long does it take to download the file over a 32 kilobit/second modem?
1 megabye = 1*10^6*8 bits; It will takes 1*10^6*8 / (32*10^3) = 250 sec.
b. How long does it take to take to download the file over a 1 megabit/second
modem?
1 Megabit = 10^6 bits. It will takes 1*10^6*8 / (10^6) = 8 sec.
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 32 kilobit and 1 megabit lines respectively:
Then 1 megabyte will be compressed into 1/6 megabyte.
T32k = 10^6*8/(6*32*10^3) ≈ 41,67 sec; T1M = 10^6*8 / (6*10^6) ≈ 1,33 sec;
Note: Explain your answer in details.
Q3. 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?
Note: Explain your answer in details.
a) In three-way handshake, to identify which connection is rejected or accepted, the initial
sequence
number is always unique. If B receives an old SYN segment form A, B will acknowledged the
request base old sequence number. When A receives the acknowledge message from B, A
will
know B used the wrong initial sequence number and discard it then reset the connection.
b) First of all, B recieves an old SYN segment, B will send a SYN segment with its
own
unique sequence number set by B. If B receives the old ACK from A, B will inform
A
that the connection is invalid since the old ACK sequence numbers does not match
the
sequence number previously defined by B. Therefore, the connection is rejected.
Q.4 A router has the following CIDR entries in its routing table:
Address/mask Next hop135.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?
First, the router will check the routing entry starting with the longest prefix (/23)
135.46.63.10 AND 255.255.254.0 = 135.46.62.0 != 192.53.40.0 therefore this entry
does not match. Next longest prefix is 22: 135.46.63.10 AND 255.255.253.0 =
135.46.60.0. Therefore this packet will routed out over Interface 1.
(b) What does the router do if a packet with an IP address 135.46.57.14 arrives?
Similarly, the router will check the routing entry starting with the longest prefix
(/23)
135.46.57.14 AND 255.255.254.0 = 135.46.56.0 != 192.53.40.0 therefore this entry
does not match. Next longest prefix is 22: 135.46.57.14 AND 255.255.252.0 =
135.46.56.0. Therefore this packet will routed out over Interface 0.
Note: Explain your answer in details.
Q5. 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.
First add 0000 to data bits string. It will be 1001110100110110000. Remainder is x
which is 0010.
Therefore, transmitted bits string is 1001110100110110010.
Note: Explain your answer in details.
Note:
- Students have to do details of each step to have result , if only write the
result, students do not have point that sentences
- Students do examination on paper

Transmission delay = Lengh * 8 bit( neu la bytes) /Rate

Propagation delay= distance/speed


Total = packet propagation take

You might also like