NWCPE Sum23

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 33

NWC203c

1, Explain the difference between connectionless unacknowledged service and


connectionless acknowledged service. How do the protocols that provide these
services differ?

Solution:.

Similarities

Connection Less:

+ Connectionless service comes with a single free-standing data unit for all
transmissions.
+ In this, each unit contains all of the protocols that control information
necessary for delivery perspective, but this also contains no provision for
sequencing or flow control.

(Dòng trên giải thích Connectionless)

Differences

Acknowledged:

+ This is achieved by the use of ACK and NAK control messages.


+ These types of protocols are well suited for communication over the network,
where high layers are very sensitive to loss and can have a significant
probability of error in these underlying networks.

Example: HDLC, which offers for unnumbered acknowledgment service(setup and


release).

(Dòng trên giải thích cho sự khác biệt của Acknowledged)

Unacknowledged:
+ This comes with a very simpler version and provides faster communication for
networks, which are inherently reliable or provide service to a higher layer,
that can tolerate loss in the information, or which has built-in error
control/recovery feature.

(Dòng trên giải thích cho sự khác biệt của Unacknowledged)

2, Explain the difference between connection-oriented acknowledged service and


connectionless acknowledged service. How do the protocols that provide these
services differ?

Differences

Connection-oriented:

+ In this type of service, a setup phase will be initialized between sender and
receiver, to establish a context for transferring the information
+ This connection is provided to the sender for all SDUs.
+ This service requires a stateful protocol, which is used to keep track of
sequence numbers, and timers.

(Dòng trên giải thích cho sự khác biệt của Connection-oriented)

ConnectionLess:

+ Here, there will be no prior context provided for transferring the information
between sender and receiver.
+ The sender will pass its SDU to an underlying layer without any notice.
+ And in this, the sender requires an acknowledgment of SDU delivery.
+ The protocols are very different in these services
+ this service also does not require transmitting protocols to track the
acknowledgment of PDU.
+ After receiving the PDU, the receiver needs to send acknowledgment, If not
received in time, then it will return failure.

(Dòng trên giải thích cho sự khác biệt của Connectionless)

3, Explain the differences between PPP and HDLC

HDLC PPP
HDLC stands for High-Level data link PPP stands for Point-To-Point protocol
control
It is a Bit-oriented protocol It is a Byte-oriented protocol
The HDLC protocol is only used for the The PPP protocol is used for both the
synchronous media asynchronous media as well as
synchronous media
It is an older protocol as compared to It is the newer protocol as compared to
PPP protocol so it does not provide any HDLC protocol which means that it
kind of authentication does provide the authentication.
In this, the addressing is not dynamic In this, the addressing is dynamic which
which means that the addressing is makes it quite more reliable than the
purely static. HDLC protocol.
As the HDLC protocol is quite old The PPP protocol is relatively newer
school which purely signifies that it does than the HDLC protocol which signifies
not support non-cisco devices at all. that it does support the non-cisco
devices.
It is more costlier than PPP It is less costlier than HDLC

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.

Solution:
For continuous transmission: Use Go-Back-N or Selective Repeat ARQ

Maximum Send Maximum Send


Window Size in Default Window Size in
HDLC Frame Extended HDLC Frame
2^7 - 1 = 127
Go-Back-N 7
64
Selective ARQ 4

The round trip propagation delay is


6
2∗Distance 2∗(375∗1 0 )
Round-Trip Propagation Delay = 2t ¿=¿ = =2.5 s
Light Speed 3∗10 8

Call n f is the smallest possible frame size, so that we got


N∗nf
=2 t ¿
Transmission Rate

Go-Back-N
7 nf
If N = 7: =2.5 s=¿ nf =535714,3 bits
1.5 Mbps

127 nf
If N = 127: =2.5 s=¿ nf =29527,5 bits
1.5 Mbps

Selective Repeat
4 nf
If N = 4: =2.5 s=¿ nf =937500 bits
1.5 Mbps

64 nf
If N=64: =2.5 s=¿ nf =58593,75 bits
1.5 Mbps

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?

Solution:
We have
R = 1,5 Mbps or R = 1,5 ×1 06 bps, and n f = 2000 bits = 250 bytes * 8
The distance that the information must travel is the Earth-to-Satellite Distance, or
D ≈ 36000 km = 3,6 ×1 07 m
The speed of light is c = 3 ×1 08 m
We can calculate the propagation delay and processing rate as follows
D 3,6 ×1 07
t¿ = = = 0,12 s = 120 ms
c 3× 1 08
nf 2000
tf = = = 0,00133s = 1,33 ms
R 1,5× 10 6

In which, t ¿ is propagation rate, t f is processing rate.


We can use either Go-Back-N or Selective Repeat ARQ.

Maximum Send Maximum Send


Window Size in Default Window Size in
HDLC Frame Extended HDLC Frame
2^7 - 1 = 127
Go-Back-N 7
64
Selective ARQ 4

If using Go-Back-N which default HDLC Frame, then N = 7.


The maximum information rate is achieved with no error, and hence, no
retransmission
t cycle =t f +2 t ¿=1,33+ 2× 120=241,33 ms

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


n = N × nf =7 × 2000=14000 bits
Then
−3
Rmax =n /t cycle=14000 /241,33 ms=14000/(241,33 ×1 0 ) s

¿ 58011,85 bps
In which, n is number of bits transmitted in a cycle, Rmax is the number of bits sent in a
cycle / minimum cycle time.

If using Go-Back-N which extended HDLC Frame,, then N = 127.

n = N × nf =127 × 2000= 254000 bits


Then
−3
Rmax =n /t cycle=254000 / 241,33ms=254000/(241,33 × 10 )s

¿ 1052500,725 bps

If using Selective Repeat which default HDLC Frame, then N = 4.

n = N × nf =4 × 2000= 8000 bits


Then
−3
Rmax =n /t cycle=8000/ 241,33 ms=8000 /(241,33× 1 0 )s

¿ 33149,63 bps

If using Selective Repeat which extended HDLC Frame, then N = 64.

n = N × nf =64 × 2000= 128000 bits


Then
−3
Rmax =n /t cycle=128000 /241,33 ms=128000/(241,33 ×1 0 )s

¿ 530394,07 bps

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.

Solution:
First, 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

∑ k × 60 Ck × ( 0.1 )k ( 1−0.1 )60−k =4.59


0

Now, the average number of packets received is 4.59 that gets transmitted 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:
6 – 4.59 = 1.41
Therefore, it will transmit 1.41 packets on average per T second from the second
line.

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.

Packets:

In networking, a packet is a small segment of a larger message.


Data sent over computer networks, such as the Internet, is divided into packets.

These packets are then recombined by the computer or device that receives them.

a)

Adaptation functions are relevant to meeting the requirements:

Message size is important because in real-time signals of voice, it is necessary to


transfer a fixed packet size that holds no more than 20 ms of the speech signal. The
handling of arbitrary message size is not as important as long as the desired packet
size for voice can be handled.

Sequencing is essential because each packet needs to arrive in the same sequence
that it was generated. Reliability is moderately important since voice transmission
can tolerate a certain level of loss and error.

Pacing and flow control are not as important because the synchronous nature of the
voice signal implies that the end systems will be matched in speed.

Timing, for real-time voice transfer, is important because this adaptation function
helps to control the jitter in the delivered signal.

Addressing is only during the connection setup phase if we assume some form of
virtual circuit packet switching method.

Privacy, integrity, and authentication have traditionally not been as important as the
other issues discussed above.

b)

Comparing a hop-by-hop approach to an end-to-end approach:


If the underlying network is reliable then the end-to-end approach is better because
the probability of error is very low so processing at the edge suffices to provide
acceptable performance.

If the underlying network is unreliable then the hop-by-hop approach may be


required. For example, if the probability of error is very high, as in a wireless
channel, then error recovery at each hop may be necessary to make effective
communication possible.

Therefore, the adaptation functions are relevant to meeting the requirements and the
comparison of hop-by-hop approach to an end-to-end approach is provided.

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?

a.

The Stop-and-Wait protocol works by sending a frame, waiting for an


acknowledgement, and then sending the next frame. If the acknowledgement
is not received, the frame is resent.

The immediate-retransmission feature modifies the protocol so that the frame


is resent as soon as an error is detected. This means that the sender does not
have to wait for the acknowledgement before resending the frame.

The protocol will still operate correctly with the immediate-retransmission


feature. If a frame is received in error, the receiver will send a negative
acknowledgement. The sender will then immediately resent the frame.

b.

The state transition diagram does not need to be modified to describe the new
operation. The only difference is that the sender will now enter the "Resend
frame" state as soon as an error is detected.

c.

The main effect of introducing the immediate-retransmission feature is to


reduce the number of frames that are lost. This is because the frame is resent
as soon as an error is detected, so there is less time for the frame to be lost in
the network.

The immediate-retransmission feature also improves the throughput of the


protocol. This is because the sender does not have to wait for the
acknowledgement before resending the frame, so the sender can send more
frames in a given period of time.

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?

a,
To exchange messages of arbitrary size, large messages must be segmented into parts
of M-H bytes
each in length to be transmitted in multiple PDUs.
Small messages must be placed in a single PDU.
b.
The peer processes need to communicate information that allows for the reassembly
of messages at
the receiver.
For example, the first PDU may contain the message length.
The last PDU may contain
and end-of-message marker.
Sequence numbers may also be useful to detect loss in connection
oriented networks and to help in reconstruction of the messages in connectionless
networks.
Lastly,
since variable size PDUs are permitted, the size of the PDU payload must be
transmitted in the PDU
header.
c.
In this case, in addition to all of the header information mentioned in b, each PDU
must be labeled
with a stream ID, so that the receiver can treat each stream independently when
reassembling
messages.
This stream ID may be avoided if the source and destination operate so that they
handle
the transfer of a single message at a time.
For example, this approach is used by AAL5 in ATM.

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?

Solution:
The file length n = 8 ×10 6 bits, the transmission rate R = 1 Mbps, and
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
P[no error in the entire file] = ( 1− p )n ≈ e−np, for n >> 1, p << 1
= e−8=3.35× 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 probability:
P[no error in subblock] = (1− p)n / N
A block has no error if all subblocks have no errors, so
P[no error in block] = P [ no error ∈subblock ] N

( ) =( 1− p )
n N
N n
¿ ( 1− p )

So simply dividing the blocks does not help.


c.

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


t total = total transmission time until success

n f = number of bits/frame

n a = number of bits per ACK

nt = number of transmissions

Pt = probability of frame transmission error

t 0 =t f + t ACK = n f / R+ n a / R (prop ≈ 0).

P[nt = i ] = P[one success after i - 1 failure] = (1 – Pf ) Pi−1


f

t total | i transmissions = i . t 0
∞ ∞
t 0 ( 1−Pf ) t0
E[t total] = ∑ i t 0 P [ nt =i ]=t o (1−P f ) ∑ i P f =
i−1
=
i=1 i=1 ( 1−P f )
2
(1−P f )

Here, n f = n >>n a, thus t 0 ≈ t f = n / R ; and Pf = 1 - P[ no error]


= 1 – e−np
E[total] = n/R (1 - Pf ) = n/[Re−np ]= 8 / (3.35 x 1 04 ) =23,847 seconds = 6.62 hours!
The file gets through, but only after many retransmissions.

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?
Solution:
a. The answer is 5. Four for the LANs (S and R), and one for the link between the
routers (R and R).

b. To support 5 subnets, we need to borrow three bits from the host portion of the IP
address.

Explaination:
We have 5 networks in total, so that if we call N (N > 0) is the number of bits
borrowed, then N is the least number that sastifies
2 N ≥5

Then N = 3.

c. Borrowing three bits creates 23= 8 subnets.


Since we have borrowed 3 bits, then the subnet mask becomes

¿ 27 :11111111.11111111 .11111111 .11100000

(We can understand that the initial subnet mask is /24, after borrowing 3 bits, the
subnet mask becomes /27)
All the network addresses are listed below
Network Address Usable Host Range Broadcast Address:
192.168.1.0 192.168.1.1 - 192.168.1.30 192.168.1.31
192.168.1.32 192.168.1.33 - 192.168.1.62 192.168.1.63
192.168.1.64 192.168.1.65 - 192.168.1.94 192.168.1.95
192.168.1.96 192.168.1.97 - 192.168.1.126 192.168.1.127
192.168.1.129 -
192.168.1.128 192.168.1.159
192.168.1.158
192.168.1.161 -
192.168.1.160 192.168.1.191
192.168.1.190
192.168.1.193 -
192.168.1.192 192.168.1.223
192.168.1.222
192.168.1.225 -
192.168.1.224 192.168.1.255
192.168.1.254

d. The last octet of an IP address has 8 bits, since we have borrowed 3 bits, so that
the answer is
28−3−2=30

So that each subnet can create 30 usable hosts.

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

Station Port

S1 1

S3 2

S4 2

S2 1

S5 2

B2

Station Port

S1 2

S3 1

S4 1

S2 1

S5 2

S1 transmits to S5

S3 transmits to S2

S4 transmits to S3

S2 transmits to S1

S5 transmits to S4

13.
Consider the network in Figure.

a) Use the Dijkstra algorithm to find the set of shortest paths from node 4 to other
nodes.
Iterati N D D D D D
on 1 2 3 5 6
Initial

b) Find the set of associated routing table entries (Destination, Next Hop, Cost)

Solution:
a, We define N is the node 4, D1, D2, D3, D5, D6 is the node 1,2,3,5,6.
Iteratio N D1 D2 D3 D5 D6
n
Initial {N} 5 1 2 3 ~

1 {N, D2} 4, D2 - 2 3 ~

2 {N, D2, D3} 4, D2 - - 3 3, D3


3 {N, D2, D3, D5, D6} 4, D2 - - - -

4 {N, D2, D3, D5, D6, - - - - -


D1}

So that, we can conclude that


+ The shortest part from N to D1 is 4, and pass D2.
+ The shortest part from N to D2 is 1.
+ The shortest part from N to D3 is 2.
+ The shortest part from N to D5 is 3.
+ The shortest part from N to D6 is 3, and pass D3.

b, Find the set of associated routing table entries (Destination, Next Hop, Cost)

Destination Cost Next Hop


D1 4 D2
D2 1 D2
D3 3 D3
D5 3 D5
D6 3 D3

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.
a. The largest required subnet is LAN-A, which needs a minimum of 50 host IP
addresses (since LAN-B needs a minimum of 40 host IP addresses, which is lower
than 50).

b. We need a minimum of 4 subnets - 2 for the required LANs and 2 additional


unused subnets for future network expansion.

c. The /24 subnet mask in binary is 11111111 11111111 11111111 00000000.

d. In the subnet mask, the ones represent the network portion, and the zeros
represent the host portion. The network portion identifies the network address,
while the host portion identifies individual hosts within the network.

e. LAN-A needs at minimum 50 host IP addresses, so that we need a subnet


mask /26 since
/26 in binary: 11111111.11111111.11111111.11000000
There are 2 ones at the beginning of the last octet so that /26 provide 22=4 subnets
as required
/26 provides 26−2=62 host per subnet, which is the smallest number that is larger
than 50.

Subnet Address Prefix Subnet Mask

192.168.0.0 /26 255.255.255.192


192.168.0.64 /26 255.255.255.192

192.168.0.128 /26 255.255.255.192

192.168.0.192 /26 255.255.255.192

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?

a,
2 things are needed to be changed:
- 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 received list contains the
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.
16. 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?

a. T 32k = 8 (1024) (1024) / 32000 = 262.144 seconds


b. T 1 M = 8 (1024) (1024) bits / 1x106 bits/sec = 8.38 seconds
c.
T 32k = 8 (1024) (1024) / (32000 x 6) = 43.69 sec

T 1 M = 8 (1024) (1024) / (1x106 x 6) = 1.4 sec

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

Let g ( x )=x 3+ x+1. Consider the information sequence 1001. Find the codeword
corresponding to the preceding information sequence. Using polynomial
arithmetic we obtain
Given an information polynomial code is g ( x )=x 3+ x+1
Now we rewrite the polynomial code as 1 × x 3+ 0 × x 2+1 × x +1 ×1 as 1011
Since polynomial is of order (3 is the higest power of g(x))
So, we add three zeros in the information sequence.
Therefore, the new polynomial code is 1001 000

Then, we add 110 to the information sequence 1001 to get the codeword:
1001110.

18,

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?

a, 135.46.63.10

When converted into binary, we have


10000111.00101110.00111111.00001010

Taking the first 22 bits of 135.46.63.10 as network address, we have

10000111.00101110.00111100.00000000 or 135.46.60.0.

The bit pattern of 135.46.63.10 is 10000111.00101110.00111111.00001010

When we perform the bit and operation with 22 leading bit 1s and 10 bit 0s, it is
equivalent of making the last 10 bit zero. We get the following network address bit
pattern: 10000111.00101110.00111100.00000000. The first two bytes are not
changed. The 3rd type changes from 63 to 60 while the 4th byte become zero.

Match with network address in the routing table. The 2rd row matches. The router
will forward the packet to Interface 1.

(b) 135.46.57.14

Taking the first 22 bits of the above IP address as network address, we have
135.45.56.0. It matches the network address of the first row. The packet will be
forwarded to Interface 0.

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:

Case 1: Organization A, 4000 request


In this case, the first address = starting address = 198.16.0.0.

Starting address 198.16.0.0 can be written as


11000110.00010000.00000000.00000000

We note that n=12 is the smallest number that satisfy 2n≥4000. Replace the last 12
bits of first IP Address with 1, then we have the last IP Address is

11000110.00010000.00001111.11111111 or 198.16.15.255

The subnet mask is derived by subtracting 12 from 32, resulting in a value of 20,
which is equivalent to using a subnet mask of /20.

So in this case, the result is 198.16.0.0 - 198.16.15.255 or can be written as


197.16.0.0/20

Case 2: Organization B, 2000 request

Remember that, the last IP assigned to A is 198.16.15.255, so that the first IP


address of B is that IP + 1, or

First IP = 198.16.15.255 + 1 = 198.16.16.0

(Bạn đọc tự thực hiện phép cộng 2 IP để có được kết quả này)

We note that n=11 is the smallest number that satisfy 2n≥2000. Replace the last 11
bits of first IP Address with 1, then we have the last IP Address is

11000110.00010000.00010111.11111111 or 198.16.23.255

The subnet mask is derived by subtracting 11 from 32, resulting in a value of 21,
which is equivalent to using a subnet mask of /21.

So in this case, the result is 198.16.16.0 - 198.16.23.255 or can be written as


197.16.16.0/21

Case 3: Organization C, 4000 request

Remember that, the last IP assigned to B is 198.16.23.255, so that the first IP


address of C is that IP + 1, or
First IP = 198.16.23.255 + 1 = 198.16.24.0
(11000110.00010000.00011000.00000000)

(Bạn đọc tự thực hiện phép cộng 2 IP để có được kết quả này)

We note that n=12 is the smallest number that satisfy 2n≥4000. But, the 12 last bits
of the first IP are not all zeros, so we have to find the nearest IP that is higher than
the first IP and satisfy that the last 12 bits are zeros. Particularly, it is
11000110.00010000.00100000 .00000000 or 198.16.32.0

(Bạn đọc tự thấy cái màu xanh lá là cái nhỏ nhất mà lớn hơn màu xanh dương và
thỏa mãn điều kiện 12 bits cuối đều là 0, xanh lá xanh dương chỉ để nhận biết, đi
thi nhớ điền các dòng xanh lá xanh dương vào và mặc kệ dòng màu đỏ này).

Replace the last 12 bits of first IP Address with 1, then we have the last IP Address
is

11000110.00010000.00101111.11111111 or 198.16.47.255.

The subnet mask is derived by subtracting 12 from 32, resulting in a value of 20,
which is equivalent to using a subnet mask of /20.

So in this case, the result is 198.16.32.0 - 198.16.47.255 or can be written as


197.16.32.0/20

Case 4: Organization D, 8000 request

Remember that, the last IP assigned to B is 198.16.47.255, so that the first IP


address of C is that IP + 1, or

First IP = 198.16.47.255 + 1 =198.16.48.0


(11000110.00010000.00110000.00000000)

(Bạn đọc tự thực hiện phép cộng 2 IP để có được kết quả này)

We note that n=13 is the smallest number that satisfy 2n≥8000. But, the 13 last bits
of the first IP are not all zeros, so we have to find the nearest IP that is higher than
the first IP and satisfy that the last 13 bits are zeros. Particularly, it is
11000110.00010000.01000000 .00000000 or 198.16.64.0
(Bạn đọc tự thấy cái màu xanh lá là cái nhỏ nhất mà lớn hơn màu xanh dương và
thỏa mãn điều kiện 13 bits cuối đều là 0, xanh lá xanh dương chỉ để nhận biết, đi
thi nhớ điền các dòng xanh lá xanh dương vào và mặc kệ dòng màu đỏ này).

Replace the last 13 bits of first IP Address with 1, then we have the last IP Address
is

11000110.00010000.01011111.11111111 or 198.16.95.255.

The subnet mask is derived by subtracting 13 from 32, resulting in a value of 19,
which is equivalent to using a subnet mask of /19.

So in this case, the result is 198.16.64.0 - 198.16.95.255 or can be written as


198.16.64.0/19

20,

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.

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 = 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.

The efficiency formula is


Efficiency=L/(L+TCP Header + IP Header + Ethernet header∧trailer )

Therefore

L = 100 bytes, 100/158 = 63,29% efficiency.


L = 500 bytes, 500/558 = 89,6% efficiency.
L = 1000 bytes, 1000/1058 = 94,51% efficiency.

21,
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?

a,
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.

b,
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.

22, Suppose a header consists of four 16-bit words: (11111111 11111111,


11111111 00000000, 11110000 11110000, 11000000 11000000). Find the Internet

checksum for this code.

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 + b 1 + b 2 + b 3 modulo 65535 = 241839 modulo 65535 = 45234


b 4= − x modulo 65535 = 20301

So the Internet checksum = 01001111 01001101

23, 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.

Given data
G = 10011
D = 1001010101
The polynomial expression of G
4 3 2
G=x ∗1+ x ∗0+ x ∗0+ x∗1+1∗1
4
¿ x + x +1

Hence the degree of the expression is 4, so that r = 4.


Add 4 zeros to the end D to obtain D’ = 100101010000
Calculating the value of R
Thus, R = 0000

24, 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, Rdprop

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?

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


= 2 ⨯10^7 m (since 1 km = 10^3 m)

Trasmission rate(R) of the direct link between A and B = 2Mbps

= 2 * 1 06 bps(1 Mbps=1 06 bps)

Propagation Speed(S) of the link between A and B = 2.5∗10 8 m/ s


Calculate the propagation delay:

d prog=Distance /Speed=(2∗107 )/(2.5∗1 08 )=0.08 s

Calculate the band-width delay product:

R * d prog=2∗1 06∗0.08=16∗1 04 bits

Therefore, band-with delay product is 160000bits

b, Size of the file = 800000 bits ¿ 8∗1 05 bits


Trasmission rate(R) of the direct link between A and B = 2Mbps
¿ 2∗1 06 bits (1 Mpbs=1 06 bps)

The band-width delay product:

R * d prog=2∗1 06∗0.08=16∗1 04 bits

Therefore, the maximum number of bits at a given time will be 160000bits.

You might also like