Cong Thuc
Cong Thuc
a.
G1(x) is used as the generating polynomial
G1(x) = x + 1 = 11 -> n=2
Step 1: Add n-1 bit 0 to the information bits => Information bits: 1101110
Step 2:
      100101
11    1101110
      11
      00011
            11
            0010
              11
                 01
R(x) = 01
Q(x) = 100101
Step 3:
Add R(x) to the information bits
-> Codeword: 1101111
b.
G2(x) is used as the generating polynomial
G2(x) = x3 + x2 + 1 = 1101 -> n=4
Step 2:
        100011
1101 110111000
        1101
        00001100
             1101
             00010
R(x) = 010
Q(x) = 100011
Step 3:
Add R(x) to the information bits
-> Codeword: 110111010
1. Let g1(x) = x + 1 and let g2(x) = x 3 + x2 + 1. Consider the information bits
(1,1,0,1,1,0).
a. Find the codeword corresponding to these information bits if g1(x) is used as the
generating polynomial.
b. Find the codeword corresponding to these information bits if g2(x) is used as the
generating polynomial.
a.
G1(x) is used as the generating polynomial
G1(x) = x + 1 = 11 -> n=2
Step 1:
Add n-1 bit 0 to the information bits => Information bits: 1101100
Step 2:
      100100
11    1101100
      11
      00011
           11
           0000
                00
                 0
R(x) = 0
Q(x) = 100100
Step 3:
Add R(x) to the information bits
-> Codeword: 1101100
b.
G2(x) is used as the generating polynomial
G2(x) = x3 + x2 + 1 = 1101 -> n=4
Step 1:
Add n-1 bit 0 to the information bits
     ->Information bits: 110110000
Step 2:
        100011
1101 110110000
        1101
        00001000
               1101
               01010
                1101
                0111
R(x) = 111
Q(x) = 100011
Step 3:
Add R(x) to the information bits
->Codeword: 110110111
2. Consider the 7-bit generator, G=10111, and suppose that D has the value
1010100001. What is the value of R? Show your all steps to have result.
G = 10111
D = 1010100001
The polynomial expression of G:
= x^4 + x^2 + x^1 + x^0
Here, the degree of the expression is 4. So, r = 4.
Thus, D + r becomes 10101000010000
Calculating the value of R:
          1001011001
10111 10101000010000
          10111
            010000
             10111
             0011101
               10111
               010100
                  10111
                  00011000
                     10111
                     01111
Therefore, the value of R = 1111
2. Consider the 7-bit generator, G=10011, and suppose that D has the value
1010101010. What is the value of R? Show your all steps to have result.
G = 10011
D = 1010101010
The polynomial expression of G:
= x^4 + x^1 + x^0
Here, the degree of the expression is 4. So, r = 4.
Thus, D + r becomes 10101010100000.
Calculating the value of R:
        1011011100
10011 10101010100000
        10011
           11001
           10011
           010100
            10011
            0011110
               10011
               011010
                10011
                010010
                 10011
                     0100
Therefore, the value of R = 0100
3. Consider the following network Figure 1. With the indicated link costs, use
Dijkstra’s shortest-path algorithm to compute the shortest path from u to all
network nodes. Show how the algorithm works by computing a table.
                  u          v            w           x             y      z
 u                -         2, u         5, u        1, u           ~      ~
 u, x             -         2, u         5, u         -            2, x    ~
 u, x, v          -          -           5, u         -            2, x    ~
 u, x, v, y       -          -           5, u         -             -     5, y
 u, x, v, y, w    -          -            -           -             -     5, y
u, v: 2
u, w: 5
u, x: 1
u, x, y: 2
u, x, y, z: 5
Ans:
(a)135.46.63.10
Taking the first 22 bits of 135.46.63.10 as network address, we have
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.
 It matches the network address of the first row. The packet will be forwarded to interface 0.
(c) 135.46.52.2
Taking the first 22 bits of the above IP address as network address, we have
135.45.52.0. It dose not matche the network addresses of the first three rows.
The packet will be forwarded to default gateway which is Router 2.
(d) 192.53.40.7
Taking the first 23 bits of the above IP address as network address, we have
192.53.40.0. It matches the network address of the third row. The packet will
be forwarded to Router 1.
(e) 192.53.56.7
Taking the first 23 bits of the above IP address as network address, we have
192.53.56.0. It does not matche the network addresses of the first three rows.
The packet will be forwarded to default gateway which is Router 2.
5. Suppose two hosts, A and B, are separated by 30,000 kilometers and are
connected by a direct link of R = 3 Mbps. Suppose the propagation speed over
the link is 2.5 x 108 meters/sec.
a. Calculate the bandwidth-delay product, R _ dprop.
b. Consider sending a file of 900,000 bits from Host A to Host B.
Suppose the file is sent continuously as one large message. What is the
maximum number of bits that will be in the link at any given time?
a.
The distance between two hosts A and B = 30,000 km = 3 * 107 meters
Transmission rate(R) of the direct link between A and B = 3Mbps = 3 * 106 bps
Propagation Speed(S) of the link between A and B = 2.5 * 108 meters/sec
                                        Distance 3∗107
Calculate the propagation delay: dprog = Speed =         =0.12 s
                                                 2.5∗108
Calculate the band-width delay product: R * dprog = 3 * 106 * 0.12 = 360000 bits
Therefore, band-with delay product is: 360000 bits
b.
Size of the file = 900 000 bits = 9 * 105 bits
Transmission rate(R) of the direct link between A and B = 3Mbps = 3 * 106 bps
The band-width delay product: R * dprog = 3 * 106 * 0.12 = 360000 bits
Therefore, the maximum number of bits at a given time will be 360000 bits
6. 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
g(x) = x3+x+1  1011
Using polynomial arithmetic we obtain:
      101
     -----------------
1011 | 1001000
     | 1011
       ---------------
      001000
         1011
        ---------------
          00110
Codeword = 1 0 0 1 1 1 0
6. Let g(x)=x3+x+1. Consider the information sequence 1011. Find the codeword
corresponding to the preceding information sequence. Using polynomial arithmetic
we obtain
g(x) = x3+x+1  1011
Using polynomial arithmetic we obtain:
       1000
     -----------------
1011 | 1011000
     | 1011
       ---------
            0000
Codeword = 1011000
7. A packet switch receives a packet and determines the outbound link to which the
packet should be forwarded. When the packet arrives, one other packet is halfway
done being transmitted on this outbound link and four other packets are waiting to
be transmitted. Packets are transmitted in order of arrival.
Suppose all packets are 2,500 bytes and the link rate is 3 Mbps. What is the
queuing delay for the packet? More generally, what is the queuing delay when all
packets have length L, the transmission rate is R, x bits of the currently-being-
transmitted packet have been transmitted, and n packets are already in the queue?
Packet length = L
Transmission rate = R
Currently transmitted packet = x bits
Waiting queue = n packets
Formula for Queuing delay:
                   [nL+ ( L−x ) ]
Queuing delay =
                        R
Given data:
L = 2500 bytes = (8 * 2500) bits
R = 3 Mbps. = 3 * 106 bit/s
   2500
X = 2 =1250 bytes = (8 * 1250) bits
n=4
Calculation:
[nL+ ( L−x ) ] ( 4∗2500+1250 )∗8
              =                  =0.03 s
     R               3∗106
9. Consider a packet of length 2,000 bytes that propagates over a link of distance
3,500 km with propagation speed of 2,5 · 108 m/s, and transmission rate 2 Mbps?
a. How long does the packet propagation take?
b. Does this propagation delay depend on the packet length?
c. Does this propagation delay depend on the transmission rate?
Length: 2000 bytes = 8 * 2000 bits
Distance: 3,500 km = 35 * 105 m
Propagation Speed 2,5 * 108 m/s
Rate: 2Mbps = 2 * 106 bit/s
a.
d/s = (35 * 105)/ (2,5 * 108) = 0,014 s = 14ms
10. Suppose Host A wants to send a large file to Host B. The path from Host A to
Host B has three links, of rates R1 = 250 kbps, R2 = 3 Mbps, and R3 = 2 Mbps.
a. Assuming no other traffic in the network, what is the throughput for the file
transfer?
b. Suppose the file is 4 million bytes. Dividing the file size by the throughput,
roughly how long will it take to transfer the file to Host B?
a)
Consider given data R1 = 250 kbps, R2 = 3 Mbps, and R3 = 2 Mbps
The throughput for the file transfer = min {R1, R2, R3} = min { 250 kbps, 3 Mbps,
2 Mbps} = 250 kbps
Thus, the throughput for the file transfer = 250 kbps
b)
Consider given data:
The file size = 4 million bytes
Convert to bits = 32 000 000 bits
-From (a), Throughput for the file transfer=250 Kbps = 250 000 bps
-File size/Throughput for the file transfer = 32 000 000 / 250 000 = 128 (second)
10. Suppose Host A wants to send a large file to Host B. The path from Host A to
Host B has three links of rates R1 = 500 kbps, R2 = 2 Mbps, and R3 = 1 Mbps.
a. Assuming no other traffic in the network, what is the throughput for the file
transfer?
b. Suppose the file is 4 million bytes. Dividing the file size by the throughput,
roughly how long will it take to transfer the file to Host B?
c. Repeat (a) and (b), but now with R2 reduced to 100 kbps.
a)
b)
Consider given data:
=32000000 bits.
=500000 bps
Dividing the file size by the throughput, roughly how long will it take to transfer
the file to Host B:
=64 seconds
c)
Repeat (a) and (b), but now with R2 reduced to 100 kbps.
Dividing the file size by the throughput, roughly how long will it take to transfer
the file to Host B:
=320 seconds
11. Suppose an application layer entity wants to send an L-byte message to its peer
process, using an existing TCP connection. The TCP segment consists of the
message plus 20 bytes of header. The segment is encapsulated into an IP packet
that has an additional 20 bytes of header. The IP packet in turn goes inside an
Ethernet frame that has 18 bytes of header and trailer. What percentage of the
transmitted bits in the physical layer correspond to message information, if L = 200
bytes, 1000 bytes, 2000 bytes.
TCP/IP over Ethernet allows data frames with a payload size up to 1460 bytes.
Therefore, L = 200, L=1000 and L= 2000 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, the total message overhead is 58 bytes
Therefore L = 200 bytes, ( 200/(200+58) ) * 100 = 77,5%
             L = 1000 byte, ( 1000/(1000+58) ) * 100 = 94.5%
             L = 2000 bytes, ( 2000/(2000+58) ) * 100 = 97,1%
11. Suppose an application layer entity wants to send an L-byte message to its peer
process, using an existing TCP connection. The TCP segment consists of the
message plus 20 bytes of header. The segment is encapsulated into an IP packet
that has an additional 20 bytes of header. The IP packet in turn goes inside an
Ethernet frame that has 18 bytes of header and trailer. What percentage of the
transmitted bits in the physical layer correspond to message information, if L = 100
bytes, 500 bytes, 1000 bytes
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/(100+58) ) * 100 = 63,3%
L = 500 byte, (500/(500+58) ) * 100 = 89,6%
L = 1000 bytes, (1000/(1000+58) ) * 100 = 94,5%
     c.
          T(35k) = (1 * 1024 * 1024 * 8) / (35000 * 6) = 39.9 (second)
          T(1M) = (1 * 1024 * 1024 * 8) / (1 * 106 * 6) = 1.39 (second)
a)
          Size text file = 1 (megabyte) = 1 * 1024 * 1024 * 8 (bit)
          Speed = 32 (kilobit/second) = 32 * 1000 (bit / second)
          => T (32k) = (1 * 1024 * 1024 * 8) / (32 * 1000) = 262.144 (seconds)
b)
          Size text file = 1 (megabyte) = 1 * 1024 * 1024 * 8 (bit)
          Speed = 1 (megabit/second) = 1 * 106 (bit / second)
          => T (1M) = (1 * 1024 * 1024 * 8) / (1 * 106) = 8.38 (seconds)
c)
          => T (32k) = (1 * 1024 * 1024 * 8) / (32 * 1000 * 6) = 43.69 (seconds)
          => T (1M) = (1 * 1024 * 1024 * 8) / (1 * 106 * 6) = 1.4 (seconds)
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
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
Data: 100111010011110
Generator polynomial: 10110-> n = 5
Step 1: Add n-1 bits 0 to the bit stream
1001110100111100000
Step 2:
          101000010100010
10110 1001110100111100000
       10110
       0010110
           10110
                010011
                 10110
                   10111
                   10110
                         10000
                         10110
                            1100 => FCS
Step 3:
Add R(x) to the information bits
->Codeword: 1001110100111101100
Bits string will be transmitted on the medium is: 1001110100111101100.
15. A bit stream 10011101 is transmitted using the standard CRC method. The
generator polynomial is x3 + 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.
Bit stream: 10011101
Generator polynomial: X3+ 1  1001 -> n = 4
Step 1: Add n-1 bits 0 to the bit stream
10011101000
Step 2:
       10001100
1001 10011101000
       1001
       00001101
              1001
              01000
                1001
                000100 (Remainder)
Step 3: Actual frame transmitted: 10011101000 – 100 = 10011101100 (modulo 2
subtraction)
Now suppose the third bit from the left is garbled and frame is received as
10111101100. Hence on dividing this by the polynomial generator we get a
remainder of 100 which shows that an error has occurred. Had the received frame
been error free we would have got a remainder of zero. See below.
       10101000
1001 10111101100
       1001
       001011
           1001
           001001
               1001
                0000100
    100 (Remainder indicating error)
------------------------------------------------------------------------------
A university has 150 LANs with 100 hosts in each LAN.
(a) Suppose the university has one Class B address. Design an appropriate subnet
addressing scheme.
b) The CIDR addressing scheme involves generating a prefix length that indicates
the length of the network mask.
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) 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?
[Answer]
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 acknowledge segment from B, A will find out that B received a wrong
sequence number. A will discard the acknowledgement packet and reset the
connection.
A bit stream 1101011011 is transmitted using the standard CRC method. The
polynomial generator is x+ x + 1. What is the actual bit string transmitted? Show
the major steps to your answer.
[Answer]
Bitstream is 1101011011
The polynomial generator is x+x=1
The Bit form = 111
Thus, n=3.
(1) The figures below show the TCP/UDP communication pattern diagrams.
Which diagram works for TCP? Why?
(2) Fill the missing steps (blank boxes) in both diagrams for TCP/UDP
correspondingly.
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.
Consider a network link that has distance of 100 meters, and signal traverses at the
speed of light in cable 2.5 x 10^8 meters per second. The link has transmission
bandwidth of 100 megabits/second (100 x 10^6 bits per second). The packet size is
400 bits. What is the signal propagation delay?
[Answer]
d = 100 megabits / second
(Cách đổi đơn vị: 100 megabits / second = 100x10^3 kilobits / seconds, đổi ngược
lại thì chia cho 1000)
v = 2.5x10^8 meters per / second
Đề này cho đã cùng đơn vị sẵn nên không cần phải đổi, lấy chia luôn.
Công thức Signal propagation delay (seconds):
=> t(prop) = d / v = 100 / (2.5x10^8) = 4x10^(-7) seconds
Consider a network link that has distance of 100 meters, and signal traverses at the
speed of light in cable 2.5 x 10^8 meters per second. The link has transmission
bandwidth of 100 megabits/second (100 x 10^6 bits per second). The packet size is
400 bits. What is the packet transmission delay?
[Answer]
L = 400 bits (packet size)
R = 100 x 10^6 (bit / sec)
Đề này cho đã cùng đơn vị sẵn nên không cần phải đổi, lấy chia luôn.
Công thức Packet transmission delay (seconds):
=> t(trans) = L / R = 400 / (100 x 10^6) = 4x10^(-6) seconds
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
TCP / IP over Ethenet allows data frames with a payload size up to 1460 bytes.
Therefore, L = 100, 500, 1000 are within this limit (chưa biết nếu vượt limit thì
khác thế nào, nhưng mình nghĩ đề ra sẽ không vượt limit đâu).
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?
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:
Note: Explain your answer in details.
[Answer]
Câu a)
(Đổi hết sang đơn vị bit và bit / second)
Size text file = 1 x 1024 x 1024 x 8 (bit)
Speed = 32 x 1000 (bit / second)
=> T (32k) = (1 x 1024 x 1024 x 8) / (32 x 1000) = 262.144 (seconds)
Câu b)
(Đổi hết sang đơn vị bit và bit / second)
Size text file = 1 x 1024 x 1024 x 8 (bit)
Speed = 1 x 1000 x 1000 (bit / second)
=> T (1M) = (1 x 1024 x 1024 x 8) / (1 x 1000 x 1000) = 8.38 (seconds)
Câu 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 (seconds)
=> T (1M) = (1 x 1024 x 1024 x 8) / (1 x 1000 x 1000 x 6) = 1.4 (seconds)
Step 3: Lấy 4 số cuối của step 2, thay số 4 số 0000 ở step 1, ta được kết quả cuối
cùng.
The transmitted bits string is 1001110100110110010. (0.5 điểm)
-------------------------------------------------------------------
Suppose two hosts, A and B, are separated by 30,000 kilometers and are
connected by a direct link of R = 3 Mbps. Suppose the propagation speed over
the link is 2.5 x 10^8 meters/sec.
a. Calculate the bandwidth-delay product, R _ dprop.
b. Consider sending a file of 900,000 bits from Host A to Host B. Suppose the
file is sent continuously as one large message. What is the maximum number of
bits that will be in the link at any given time?
A)ta có
A và B cách nhau 30000km-->3*10^7 mét(1km bằng 10^3m)
Tốc độ truyền tải (R) của liên kết trực tiếp giữa A và B = 3 Mbps--> 3*10^6
bps(1Mbps = 10^6 bps)
Tốc độ lan truyền (S) của liên kết trực tiếp giữa A và B = 2.5*10^8 mét/s
                          giải
-Calculate the propagation delay(độ delay tốc độ lan truyền)
d(prog) = (khoảng cách)/(tốc độ)= 3*10^7/2.5*10^8= 0.12 sec(giây)
- Calculate the band-width delay product(Tính tích số trễ độ rộng băng tần)\
R * d(prog) = 3*10^6 * 0.12 = 36*10^4 bits
band-width delay product là 360000 bits
---------------------------------------------------------------------
7. A packet switch receives a packet and determines the outbound link to which
the packet should be forwarded. When the packet arrives, one other packet is
halfway done being transmitted on this outbound link and four other packets are
waiting to be transmitted. Packets are transmitted in order of arrival.
Suppose all packets are 2,500 bytes and the link rate is 3 Mbps. What is the
queuing delay for the packet? More generally, what is the queuing delay when all
packets have length L, the transmission rate is R, x bits of the currently-
beingtransmitted packet have been transmitted, and n packets are already in the
queue?
package length = L
transimision rate = R
curently transimitted packet = x bits
Waiting queue = n package
-Công thức queuing delay
Queuing delay = [(nL) + (L-x)]*R(Mbps)*n/R(bps)
ta có
L = 2500 bytes
R = 3 Mbps = 3*10^6 bps
x = 2500/2 = 1250 (transmit halfway)
n = 4(do có 4 package đang chờ chuyển)
              giải
-[nL + (L-x)] = [(4*2500) + (2500-1250)]
           10000 + 1250 = 11250 bytes
-Package transmit rate at 3Mbps
11250*3*4=135000
-Queuing delay = 135000/3*10^6 = 0.045 sec(giây)
------------------------------------------------------
Consider a packet of length 2,000 bytes that propagates over a link of
distance 3,500 km with propagation speed of 2,5 · 108 m/s, and
transmission rate
2 Mbps?
a. How long does the packet propagation take?b. Does this propagation delay
depend on the packet length?
c. Does this propagation delay depend on the transmission rate?
a.
Length: 8 * 2000 bit
Distance: 35 * 105 m
Propagation Speed 2,5 * 108 m/s
Rate: 2 * 106 bit/s
(35 * 105 )/ (2,5 * 108) = 0,014 s = 14ms
b. No
c. No
-------------------------------------------------------------------
Suppose Host A wants to send a large file to Host B. The path from Host A
to Host B has three links, of rates R1 = 250 kbps, R2 = 3 Mbps, and R3 = 2
Mbps.
a. Assuming no other traffic in the network, what is the throughput for thefile
transfer?
b. Suppose the file is 4 million bytes. Dividing the file size by the throughput,
roughly how long will it take to transfer the file to Host B?
R1 = 250 kbps
R2 = 3 Mbps
R3 = 2 Mbps
a. Throughput
- Bandwidth (Băng thông): Độ rộng của đường truyền tin. (Khoảng chênh lệch
giữa thành phần tần số thấp nhất tới thành phần tần số cao nhất trong 1 tín hiệu =
Hz) => Khả năng truyền đc nhiều dữ liệu tại 1 thời điểm là càng lớn. Đo bằng bit/s
- Tốc độ truyền (Transimission Rate): Là tốc độ truyền được bao nhiêu bit /s. Đo
cũng bằng bit/s
- Thông lượng (Throughput): Là số lượng bit hữu ích truyền đi trong 1 s. bit/s.
Luôn nhớ: thông lượng <= tốc độ truyền
A) the throughput for the file
transfer = min{R1,R2,R3}= min{250 kbps, 3 Mbps, 2 Mbps} = 250kbps
--------------------------------------------------------------
Three users are sharing a common link of 1 Mb/s. User A is
downloading large files and is connected to the common link via a slow access link
at x
Mb/s, user B is connected via a 100 Mb/s link, but the application she is using
requires at
most x Mb/s, and finally user C is connected via a 1 Gb/s link and is downloading
a
movie that can take up any amount of bandwidth available to it. What is the max-
min fair
allocation for these three flows at the common link?
Two Cases: 1) If x < 1/3Mb/s then A and B get x Mb/s, C gets (1-2x)Mb/s,
otherwise A, B,
and C get 1/3 Mb/s
----------------------------------------------------
If Host C already knew 12 of the bits (e.g. because it knew something about the
pseudo-random ISN generator), on average how many guesses would it take to get
it
right?
2^19
If Host C wanted to send a spoofed email to A, it would take just one “guessed”
packet. Assuming the e-mail body and packet headers were 1500bytes, given a
1Gb/s
link (and assuming that C already knew 12 bits of the sequence number), on
average
how long would it take to send one e-mail with a spoofed source?
2^19 * 1500bytes * 8bits/byte * 1/ 10^9 = 6.3seconds
(b.) What simple change could you add to the SMTP protocol to defend against
this
attack?
Send an application level challenge and wait for a response before sending the
message.
(Multiple answers were accepted for this. Solutions requiring secrets or keys
were docked points because this is a public mail system.)
(c.) (See Figure on next page). A variant of spoofing is used to protect a
highbandwidth (and thus valuable) machine by forging the source of a lower
bandwidth (less valuable) machine also under the attacker’s control. The
victim’s return packets are then forwarded by the low-bandwidth host back to the
high-bandwidth host which then can retrieve the correct sequence number.
Assuming the low bandwidth host is connected to a 56Kb/s link and the high
bandwidth host has a 1Gb/s connection, how many messages per second can the
high bandwidth server send (again use single packet e-mail messages of
1500bytes)?
Acks on the 56k link are the bottleneck in this attack. Since an ACK is generally
64 bytes
56k/(64*8bits) = 109messages/sec
If Host C already knew 12 of the bits (e.g. because it knew something about the
pseudo-random ISN generator), on average how many guesses would it take to get
it
right?
2^19
If Host C wanted to send a spoofed email to A, it would take just one “guessed”
packet. Assuming the e-mail body and packet headers were 1500bytes, given a
1Gb/s
link (and assuming that C already knew 12 bits of the sequence number), on
average
how long would it take to send one e-mail with a spoofed source?
(d.) Does your fix for part (d) above also apply to this form of spoofing?
In general, any solution that relied on the attacker not receiving the initial
SYN|ACK does not work in this setup.
------------------------------------------------------------
The area under the sawtooth is (1/2 * W/2 * W/2) + (W/2 * W/2) = 3/8 * W^2. The
probability that a packet will be dropped is 1/(3/8 * W^2) (1 drop per sawtooth).
Solving for W, we see W = sprt(8/3*p) The average window is equal to 3/4 of W,
which is sqrt(3/2p)
(b.) Using your answer to part (a), what is the average number of round-trip times
between loss events that TCP can tolerate so as to sustain an average windowsize
of w packets. Observe that the time interval between losses needs to increase
as the "pipe" size increases.
Since the average window, w[a], is equal to 3/4 of W ˆ , then we can see that W ˆ is
equal to 4/3 of wa. (W*RTT)/2 is the time interval between loss events.
Therefore, we need (2/3)*w[a] * RTTs between loss events
(c.) Let’s see what it takes to fill the pipe (i.e. achieve 10Gb/s). To achieve 10Gb/s,
we need an average window size of
!
10Gb/s " 200ms ÷1500bytes
(we are
assuming the packets are 1500bytes long). How low a loss-rate do we need for
this to happen? Comment on your answer.
The average window size is
(10*10^9*200*10^-3)/1500*8 = (5*10^5)/3 = 166666.67
packets. Using the equation from part (a), we can see that sqrt (3/2P) = 166666.67.
Solving for p, we see that we need a 5.4x10^-11 loss rate.
The average window per cycle is equal to the sum of one half of the smallest
window size and largest window size. The largest window equals ^W and the
smallest window is equal the drop factor multiplied by ^W. Therefore,
w = 1/2 ((1-b)*W + W) = (((1-b)*W + W)/2) = ((2-b)/2)*W
(e.) Alice argues that Alice-TCP is better. She says that if we want to sustain a
particular average window size, the number of round-trip times between losses is
independent of the pipe size. Is she correct? Explain your answer.
Show that for MIMD TCP, the following holds true:
pw[a] = a/b (1 - b/2) =: p
So, the number of round-trips times between losses for a sustainable average
window size, wa, does not increase with the pipe size!
One way to do this would be to write a differential equation for rate change and
equate it to 0 for the equilibrium
where x[i](t):= w[i](t)/T[i]. Now equate equilibrium rate change x[i](t) to zero.
-------------------------------------------------------------------
(a.) What is the maximum backlog (in packets) at the queue corresponding to flow
A?
5 packets
Packets of flow B follow a modified leaky-bucket model: The number of arrivals
until time t is given by a(0,t)<= 5 + t
c.) Can this traffic be modeled as leaky-bucket traffic? If so, what are the
corresponding σ and ρ parameters? If not, explain why.
Yes. σ=1000 and ρ=100
(d.) At a given time, assume packet p of flow A is scheduled to leave the router
before packet q of flow B. Is it possible that a future arriving packet changes the
departure order of these packets? Why?
When any two packets have been scheduled, they have been placed in order of
increasing Finishing Time (as determined by the WFQ scheduler). They then
leave in order of Finishing Time. Therefore, once scheduled, their departure
order is fixed
----------------------------------------------------------------------------------
Leaky-bucket constrained traffic. In this question we’ll assume that
flowsconsist of a stream of bits rather than packets. In class, we saw how a leaky
bucket
regulator can constrain a flow so that the number of bits sent in an interval of
duration
τ is given by: A (t, t +τ) ≤ σ + ρτ. If you think about it, this leaky bucket would
allow a
burst of up to σ bits to depart from the source in zero time (i.e. at an infinite rate)!
This is
clearly not possible; so in practice, the source is constrained by the data rate of its
outgoing link. We’ll assume that the flow is constrained by a leaky bucket at the
source,
and that a burst can depart no faster than R bits/second (the data rate of the link to
which
the source is connected). The figure below shows how the traffic is constrained.
The flow
passes through ten routers, all of which use bit-by-bit weighted fair queuing to
serve
(a.) If the first router allocates the flow a service rate greater than or equal to c
(where
ρ ≤ c), write down expressions for the maximum delay of a bit in the router, and
the size of the buffer needed to prevent overflows. (Write your answers in terms
of σ, ρ and R, but not c).
(b.) What happens to your answer in (a) when R = ρ ? Explain your answer.
No buffer is needed
(c.) Why do you think it is customary to assume that a burst can leave a leaky
bucket
regulator at infinite rate?
R is usually much greater than rso the answer changes very little when using R
--------------------------------------------