1
ENGG1015 Tutorial
Networking (II)(Class A) Nov 21 and (Class B) Nov 22Teaching Objectives
Evaluate the network performanceNews
Project final presentation (28 Nov)HW 3 (25 Nov)
Ack.: UK Imperial College Communications 2
2
Revision Tutorial
6 Dec, 2:00-4:30Lecture Room – Chong Yuet Ming, P35 Sessions
2:00 – 2:25 Digital Image2:30 – 2:55 Circuits3:05 – 3:30 Networking3:35 – 4:05 Digital Logic4:10 – 4:30 Computer Arithmetic
3
Question 1: Network Performance
Host A converts analog voice to a digital 64 kbps bit stream. Host A then groups the bits into 48-byte packets. There is one link between host A and B; its transmission rate is 1 Mbps and its propagation delay is 2 msec. As soon as Host A gathers a packet, it sends it to Host B. As soon as Host B receives an entire packet, it coverts the packet’s bits to an analog signal.
How much time elapse from when a bit is created until a bit is decoded?What if the packets are 1,500-byte and the transmission rate is 155 Mbps?
4
Solution 1
Host A converts analog voice to a digital 64 kbps bit stream. Host A then groups the bits into 48-bytepackets (1 byte = 8 bits) ……
In a packet, 48 bytes x 8 bits/byte = 384bits Time from a bit is created to a packet is sent384bits / 64kbps = 5.859ms
5
Solution 1
… There is one link between host A and B; its transmission rate is 1 Mbps and its propagation delay is 2 msec. …As soon as Host A gathers a packet, it sends it to Host B. As soon as Host B receives an entire packet, it coverts the packet’s bits to an analog signal. (No other time delay)How much time elapse from when a bit is created until a bit is decoded?
Transmission time 384bits / 1Mbps = 0.366msTime from a bit is created to a bit is decoded5.859msec + 0.366msec + 2msec = 8.225ms
6
Solution 1What if the packets are 1,500-byte and the transmission rate is 155 Mbps?In a packet
1,500bytes x 8bits/byte = 12,000bitsTime from a bit is created to a packet is sent
12,000bits / 64kbps = 183msTransmission time
12,000bits / 155Mbps = 0.074msec = ~0Time from a bit is created to a bit is decoded
183msec + 2msec = 185ms
7
Question 2: Network Performance
Consider an application which transmits data at a steady rate. Also, when such an application starts, it will stay on for relatively long period of time.Assume a header size of 20 bytes each at the transport, network and link layers. Analyze the amount of excess bytes transmitted in a data transfer of 5 MB, for packet sizes of 50 bytes, 500 bytes and 1,000 bytes.
What would you fix as the packet size for minimizing excess transmission? Do you see any issues with your answer?
8
Solution 2
Assume a header size of 20 bytes each at the transport, network and link layers. Analyze the amount of excess bytes transmitted in a data transfer of 5 MB, for packet sizes of 50 bytes, 500 bytes and 1,000 bytes.
Overhead per packet= Header bytes at (transport + network + link) layers= 20 + 20 + 20 = 60bytes
9
Solution 2
Assume a header size of 20 bytes each at the transport, network and link layers. Analyze the amount of excess bytes transmitted in a data transfer of 5 MB, for packet sizes of 50 bytes, 500 bytes and 1,000 bytes.
6%0.005M x 60=0.3M5M/1,000=0.005M1,00012%0.01M x 60=0.6M5M/500=0.01M500
120%0.1M x 60=6M5M/50=0.1M50
ExcessTotal Header bytes# Packets in 5MBPacket Size (bytes)
10
Solution 2
What would you fix as the packet size for minimizing excess transmission? Do you see any issues with your answer?
For minimum excess transmission, we need to fix the packet size to be the size of the file. Hence we will send only one packet.This makes the transmission time of the packet very high, thereby making the protocol less agile to packet losses.
11
Question 3a
The network between Computer A and Computer B has a maximum bandwidth of 10 Mbps, a fixed packet size of p bytes, and a fixed header size of h bytes.
Assume that Computer A and Computer B are physically separated by 1200 km. Using the fact that the speed of light is roughly 3 x108 m/s, how long does it take the first bit of information from Computer A to arrive at Computer B?How long does it take one packet sent by Computer A to arrive completely at Computer B? Will your answer be changed if Computer A is sending just 1 byte to Computer B?
12
How long does it take the first bit of information from Computer A to arrive at Computer B?
How long does it take one packet sent by Computer A to arrive completely at Computer B? Will your answer be changed if Computer A is sending just 1 byte to Computer B?
The time needed to send 1 byte is the same as to send 1 packet because the network protocol defines a fixed packet size for transfer. Therefore, a entire packet of a fixed size of p must be transmitted.
Solution 3a
3
8
distance 1200 10Time 4speed of light 3 10
ms×= = =
×
( )3 46
packet size 8Time latency 4 10 4 1 2 10bandwidth 10 10
p p ms− −= + = × + = ⋅ + ××
13
Question 3b
What is the latency of the network?
In a packet switched network, bandwidth must be used up to transmit headers as well as the data payloads. The effective amount of data that can be sent through a network is therefore smaller than its stated bandwidth, and is called its throughput.
Given this definition, what is the theoretical maximum throughput that this network can transmit data at?
14
Solution 3b
What is the latency of the network?
The latency of the network is the time required to get the first byte of data across a network.Since an entire packet must be transmitted even for 1 byte, the latency of the network is the time to transfer 1 packet. That is, the latency of the network is:
( )44 1 2 10 p ms−⋅ + ×
15
Solution 3b
What is the theoretical maximum throughput that this network can transmit data at?
The maximum throughput is achieved if the network is transmitting nothing but back-to-back packets.Since within each packet h bytes must be used for header out of the p packet, the effective amount of data transferred is p − h. Therefore, the maximum throughput of the network is: ( )10 p h
Mbpsp−
16
Question 3c
You wrote a piece of code that transmits a large file of (10000 x p) bytes from Computer A to Computer B. You wrote the code such that each packet transmits exactly 1 byte of the file.Assuming packets can be transmitted on the network one right after each other, what is the throughput of transmitting the large file?
You rewrote the code such that each packet transmits exactly p - h bytes data. What is the throughput of transmitting the large file in this case?
17
Solution 3c
What is the throughput of transmitting the large file?
The file is sent 1 byte at a time, and each byte must be sent by 1 packet that is p byte long. As a result, the throughput of the file transfer is1 10Mbpsp×
18
Solution 3c
You rewrote the code such that each packet transmits exactly p-h bytes data. What is the throughput of transmitting the large file in this case?
The question should read that each transfer is exactly p − h bytes, not p bytes.All transferred packets will contain exactly p−h bytes, which is the maximum payload size. As a result, the maximum theoretical throughput of the network computed will be achieved.The throughput achieved will be
( )10 p hMbps
p−
19
Appendix: Key concepts of networking
Computer Network (L10) vs. Internet (L11-12)Computer Network (Mainly L10)
LAN, WAN, Internet…Circuit Switching vs. Packet Switching
Key Idea, Examples, and Pros & ConsPacket Switching
Packet = Header + PayloadRouting: Source Routing, and Multi-Hop Routing, Forwarding: Store-and-Forward, and Cut-ThroughMessage Segmenting/SwitchingPerformance: Latency, Throughput
OSI Protocol: 7 Layers (L11)
20
Appendix: Key concepts of networking
Internet (L11-12)3 Big Ideas (Mainly L11)
Packet Switching (L10)Layering: Service Model, 5-Layer Protocol, header & dataEnd-to-End
IP (L11)IP Layer = Network Layer (Roughly)IPv4 and IPv6Service Model: Best Effort; Services: Addressing and Delivery
TCP (L12)
21
Quick Checking
Host A converts analog voice to a digital 64 kbpsbit stream. Host A then groups the bits into 48-byte (384-bit) packets.
What is the time from a bit is created to a packet is sent?
22
Quick Checking
Host A converts analog voice to a digital 64 kbpsbit stream. Host A then groups the bits into 48-byte (384-bit) packets.
The time from a bit is created to a packet is sent384bits / 64kbps = 5.859ms