Computer Networks ENGG1015 1 st Semester, 2010 Hayden Kwok-Hay So
Where are we in the semester? High Level Applications Systems Digital Logic Image & Video Processing Computer & Embedded Systems Computer Network Mobile Network Combinational Logic Boolean Algebra Circuits Basic Circuit Theory Low Level Electrical Signals Voltage, Current Power & Energy 1st semester, 2010 ENGG1015 - Network - Dr. H. So 2
Introduction Computer Network: A collection of communicating computers 1st semester, 2010 ENGG1015 - Network - Dr. H. So 3
Categorizing Computer Networks LAN Network that covers a small geometrical area. A company, a university, home, etc WAN Network that covers a relatively larger geometrical area. Usually beyond a building, a city, or even a country Global network? Beyond the Earth? Many other ways to categorize networks 1st semester, 2010 ENGG1015 - Network - Dr. H. So 4
Direct Connections Computer C Number of links proportional to number of computers Computer D Computer A Direct (Physical) Connection Computer B 1st semester, 2010 ENGG1015 - Network - Dr. H. So 5
Switching Network Computer C Computer D switch Computer A Must share the physical connection to A to support data connection to/from C, D Computer B 1st semester, 2010 ENGG1015 - Network - Dr. H. So 6
How to share resources (switch)? Two important ways of network communication: Circuit switching dedicated circuit per connection e.g. public switch telephone network (PSTN) Packet switching Data sent through the network in discrete packets e.g. Internet 1st semester, 2010 ENGG1015 - Network - Dr. H. So 7
Circuit Switching End-to-end resources reserved for exclusive use by each connection Network resources (e.g., bandwidth) divided into pieces Pieces allocated to each connection Guaranteed performance Resource piece idle if not used by owning call (no sharing) How to divide resources? frequency division time division 1st semester, 2010 ENGG1015 - Network - Dr. H. So 8
Packet Switching A 10 Mbs Ethernet statistical multiplexing C B queue of packets waiting for output link D 1.5 Mbs E Each end-end data stream divided into packets Different users share the same resource as needed Excessive queuing might cause packet drop 1st semester, 2010 ENGG1015 - Network - Dr. H. So 9
Packet switch vs circuit switch 1 Mbit link each user: 100 kbps when active active 10% of time N users 1 Mbps link circuit-switching: 10 users packet switching: with 35 users, probability that > 10 users active is less than.0004 Packet switching allows more users to use network! 1st semester, 2010 ENGG1015 - Network - Dr. H. So 10
Packet Implementation Header Payload Two main parts of a packet: Header Payload Header: Meta information about the content of the packet e.g. Source and destination address, type of packet, length etc Payload: The actual content of the packet Length of payload specified in header, or it might be a fixed length In case of fixed length payload: padding is needed 1st semester, 2010 ENGG1015 - Network - Dr. H. So 11
Packet Routing The header of a packet states should contains enough information for the delivery of a packet. The processing of determining and delivering packets is called routing. Two common ways to route: Source routing Multi-hop routing 1st semester, 2010 ENGG1015 - Network - Dr. H. So 12
Source Routing Before a packet is sent, the source has already figured out the complete route the destination Store the calculated route in the header of a packet Similar to a direction to a location: Turn left at the 1 st traffic light, then Go straight, then Turn right at the postoffice No address is needed. 1st semester, 2010 ENGG1015 - Network - Dr. H. So 13
Multi-hop Routing Only need destination address in the packet Machines along the way determine how to deliver the packet to the destination Each computer-computer transfer is referred as a hop. Usually designated machines are used only for routing purposes, we call them routers. 1st semester, 2010 ENGG1015 - Network - Dr. H. So 14
Packet Forwarding Techniques A B Packets must travel from point A to point B via many intermediate points How should each intermediate point handle the packet? Two common switching methods: Store-and-forward Cut-through 1st semester, 2010 ENGG1015 - Network - Dr. H. So 15
Store-and-Forward A B Packets are forwarded out only after the entire packet has been received Easy to implement Allow error checking at each intermediate steps Need big buffers Transfer latency proportional to the number of hops 1st semester, 2010 ENGG1015 - Network - Dr. H. So 16
Store-and-Forward Performance L R R R Takes L/R seconds to transmit (push out) packet of L bits on to link of R bps Entire packet must arrive at router before it can be transmitted on next link delay = 3*L/R Example: L = 7.5 Mbits R = 1.5 Mbps delay = 15 sec 1st semester, 2010 ENGG1015 - Network - Dr. H. So 17
Packet Switching: Message Segmenting Now break up the message into 5000 packets Each packet 1,500 bits 1 msec to transmit packet on one link pipelining: each link works in parallel Delay reduced from 15 sec to 5.002 sec 1st semester, 2010 ENGG1015 - Network - Dr. H. So 18
Cut-Through Forwarding Packets are forwarded as soon as its destination address is known Destination address preferred to be at the front of a packet Cannot perform error checking Error can only be detected once the entire packet has arrived at the router. No need for large packet buffers Can cause queue-blocking or even deadlock in some networks Lower latency than store-and-forward, but throughput the same. 1st semester, 2010 ENGG1015 - Network - Dr. H. So 19
Is packet switching always better? Great for bursty data resource sharing simpler, no call setup Excessive congestion: packet delay and loss protocols needed for reliable data transfer, congestion control Q: How to provide circuit-like behavior? bandwidth guarantees needed for audio/ video apps still an unsolved problem 1st semester, 2010 ENGG1015 - Network - Dr. H. So 20
Announcements Homework 3 is online now Due in 2 weeks: 11/24 18/11: Lecture venue will be moved to CYC-A 1/12: Final project presentation + competition 20/12: Final exam Reference textbooks at http://www.eee.hku.hk/~engg1015/fa10/ links.html 1st semester, 2010 ENGG1015 - Network - Dr. H. So 21
1st semester, 2010 ENGG1015 - Network - Dr. H. So 22
Measuring Network Performance Latency Throughput Measures the time to get the first byte of data across a network Unit: seconds (s) Measures the aggregated amount of data transported over a period of time Unit: byte per second (Bps) or bit per second (bps) 1st semester, 2010 ENGG1015 - Network - Dr. H. So 23
Example: Mailing DVDs Mailing a DVD takes 1 day = 24 hours = 86400s Each DVD is 4GB Latency is 86,400s Throughput is an average value. If we mail 1 DVD everyday, then the throughput is: 4GB / 86400s 46.2 kbps 370 kbps 1st semester, 2010 ENGG1015 - Network - Dr. H. So 24
Example: scaling up What if we mail 100 DVDs at the same time? Latency remains the same: 86400s Bandwidth increases by 100 times 37 Mbps In other words, mailing 100 DVDs at the same has higher throughput than your average broadband internet access at home. 1st semester, 2010 ENGG1015 - Network - Dr. H. So 25
Physical Mail vs Network When the data transfer is large, traditional postal mail has much higher bandwidth than any Internet connection E.g. Amazon AWS Import/Export allows company to send data to the Internet cloud by physically sending hard drives. When is physical mail faster? Available Internet Connection Theoretical Min. Number of Days to Transfer 1TB at 80% Network Utilization When to Consider AWS Import/Export? T1 (1.544Mbps) 82 days 100GB or more 10 Mbps 13 days 600GB or more T3 (44.736Mbps) 3 days 2TB or more 100 Mbps 1-2 days 5TB or more 1000 Mbps < 1day 60TB or more 1st semester, 2010 ENGG1015 - Network - Dr. H. So 26
Which one to use? Both are important Latency is more important when small amount of data is needed to be sent back-and-forth very quickly Interactive applications such as: Web surfing, online game, remote log in, etc Microprocessor network Throughput is more important when streaming data are considered Video streaming Music streaming Large file transfer 1st semester, 2010 ENGG1015 - Network - Dr. H. So 27
Which network is better? time time time Network A has low latency and low throughput Network B has high latency, high bandwidth Network C has moderate latency, moderate throughput, and unpredictable performance 1st semester, 2010 ENGG1015 - Network - Dr. H. So 28
Which network is better? (A) time time time Network A is the best for short, bursty traffic, such as web browsing. Think of the first yellow packet as all you need for 1 web page Email, IM (MSN messenger, gtalk,etc) are all examples of short bursty traffic 1st semester, 2010 ENGG1015 - Network - Dr. H. So 29
Which network is better? (B) time time Network B has the longest latency (longest wait time) But once the data arrive, it has the highest bandwidth Network B is best for streaming data E.g. youtube, and any other streaming data time 1st semester, 2010 ENGG1015 - Network - Dr. H. So 30
Which network is better? (C) time time time Network C is difficult to classified Network C is the most realistic model of today s ISP s capability 1st semester, 2010 ENGG1015 - Network - Dr. H. So 31