Download presentation
Presentation is loading. Please wait.
Published byHollie Manning Modified over 8 years ago
1
1 Computer Networks An Introduction to Computer Networks University of Tehran Dept. of EE and Computer Engineering By: Dr. Nasser Yazdani Lecture 2: Foundation
2
Univ. of TehranIntroduction to computer Network2 Outline Objectives Statistical Multiplexing Inter-Process Communication Network Architecture Layering Performance
3
Univ. of TehranIntroduction to computer Network3 Introduction Building a network to support diverse ranges of applications Distributed computing. Multimedia. Telecommunication. E-commerce, etc. What kind of technology do we need? Hardware. Software.
4
Univ. of TehranIntroduction to computer Network4 First Step What is computer Network? Different views. Differences from other networks, Its generality. What is requirements? Different perspective: Network provider Network designer Application programmer
5
Univ. of TehranIntroduction to computer Network5 Design goals Connectivity Scalability Simplicity For designers. Most importantly for users. Efficiency cost performance Support for common user services.
6
Univ. of TehranIntroduction to computer Network6 An Ex. the mail system NickDave Stanford MIT Admin
7
Univ. of TehranIntroduction to computer Network7 Characteristics of the mail system Each envelope is individually routed. No time guarantee for delivery. No guarantee of delivery in sequence. No guarantee of delivery at all! Things get lost How can we acknowledge delivery? Retransmission How to determine when to retransmit? Timeout? Need local copies of contents of each envelope. How long to keep each copy. What if an acknowledgement is lost?
8
Univ. of TehranIntroduction to computer Network8 The mail system NickDave Stanford MIT Admin Application Layer Transport Layer Network Layer Link Layer
9
Univ. of TehranIntroduction to computer Network9 The Internet NickDave Leland.Stanford.edu Athena.MIT.edu Network Layer Link Layer Application Layer Transport Layer O.S. HeaderDataHeaderData Datagram
10
Univ. of TehranIntroduction to computer Network10 Characteristics of the Internet Each packet is individually routed. No time guarantee for delivery. No guarantee of delivery in sequence. No guarantee of delivery at all! Things get lost Acknowledgements Retransmission How to determine when to retransmit? Timeout? Need local copies of contents of each packet. How long to keep each copy? What if an acknowledgement is lost?
11
Univ. of TehranIntroduction to computer Network11 Characteristics of the Internet (2) No guarantee of integrity of data. Packets can be fragmented. Packets may be duplicated.
12
Univ. of TehranIntroduction to computer Network12 An Introduction to the mail system NickDave Stanford MIT Admin Application Layer Transport Layer Network Layer Link Layer
13
Univ. of TehranIntroduction to computer Network13 Some questions about the mail system How many sorting offices are needed and where should they be located? How much sorting capacity is needed? Should we allocate for Mother’s Day? How can we guarantee timely delivery? What prevents delay guarantees? Or delay variation guarantees? How do we protect against fraudulent mail deliverers, or fraudulent senders?
14
Univ. of TehranIntroduction to computer Network14 More questions about the mail system What happens when a router fails? How can we prevent swamping the routers with data too quickly? How can we prevent sending data too slowly?
15
Univ. of TehranIntroduction to computer Network15 Building Blocks Nodes: PC, special-purpose hardware… hosts switches, routers and gateways Links: coax cable, optical fiber… point-to-point multiple access …
16
Univ. of TehranIntroduction to computer Network16 Switched Networks two or more nodes connected by a link, or two or more networks connected by two or more nodes A network can be defined recursively as...
17
Univ. of TehranIntroduction to computer Network17 Strategies Circuit switching: carry bit streams Connection oriented. original telephone network Dedicated resource. Packet switching: store-and-forward messages Connectionless (IP) or connection oriented (ATM) Internet Shared resource. Packet switching is the focus of computer Networks.
18
Univ. of TehranIntroduction to computer Network18 Circuit Switching A B SourceDestination It’s the method used by the telephone network. A call has three phases: 1.Establish circuit from end-to-end (“dialing”), 2.Communicate, 3.Close circuit (“tear down”). Originally, a circuit was an end-to-end physical wire. Nowadays, a circuit is like a virtual private wire: each call has its own private, guaranteed data rate from end- to-end.
19
Univ. of TehranIntroduction to computer Network19 Circuit Switching Telephone Network Source “Caller” Central Office “C.O.” Destination “Callee” Central Office “C.O.” Trunk Exchange Each phone call is allocated 64kb/s. So, a 2.5Gb/s trunk line can carry about 39,000 calls.
20
Univ. of TehranIntroduction to computer Network20 Packet Switching A R1 R2 R4 R3 B SourceDestination It’s the method used by the Internet. Each packet is individually routed packet-by-packet, using the router’s local routing table. The routers maintain no per-flow state. Different packets may take different paths. Several packets may arrive for the same output link at the same time, therefore a packet switch has buffers.
21
Univ. of TehranIntroduction to computer Network21 Packet Switching Simple router model R1 Link 1 Link 2 Link 3 Link 4 Link 1, ingressLink 1, egress Link 2, ingressLink 2, egress Link 3, ingressLink 3, egress Link 4, ingressLink 4, egress Choose Egress Choose Egress Choose Egress Choose Egress “4”
22
Univ. of TehranIntroduction to computer Network22 Addressing and Routing Address: byte-string that identifies a node usually unique Routing: process of forwarding messages to the destination node based on its destination address Types of addresses unicast: node-specific broadcast: all nodes on the network multicast: some subset of nodes on the network
23
Univ. of TehranIntroduction to computer Network23 Multiplexing (resource sharing) Time-Division Multiplexing (TDM) Frequency-Division Multiplexing (FDM) L1 L2 L3 R1 R2 R3 Switch 1Switch 2
24
Univ. of TehranIntroduction to computer Network24 Statistical Multiplexing On-demand time-division Schedule link on a per-packet basis Packets from different sources interleaved on link scheduling fairness, quality of service Buffer packets that are contending for the link Buffer (queue) overflow is called congestion …
25
Univ. of TehranIntroduction to computer Network25 Statistical Multiplexing Basic idea time rate One flow Two flows Average rate Many flows Network traffic is bursty. i.e. the rate changes frequently. Peaks from independent flows generally occur at different times. Conclusion: The more flows we have, the smoother the traffic. Average rates of: 1, 2, 10, 100, 1000 flows. rate
26
Univ. of TehranIntroduction to computer Network26 Link rate, R X(t)X(t) B Dropped packets Queue Length X ( t ) Time Packet buffer Packets for one output Packet Switching Statistical Multiplexing DataHdr DataHdr DataHdr R R R Because the buffer absorbs temporary bursts, the egress link need not operate at rate (N x R). But the buffer has finite size, B, so losses will occur. 1 2 N
27
Univ. of TehranIntroduction to computer Network27 Statistical Multiplexing B A time Rate C C A C B C
28
Univ. of TehranIntroduction to computer Network28 Statistical Multiplexing Gain A B R 2C2C R < 2C A+B time Rate Statistical multiplexing gain = 2C/R Other definitions of SMG: The ratio of rates that give rise to a particular queue occupancy, or particular loss probability.
29
Univ. of TehranIntroduction to computer Network29 Why does the Internet use packet switching? 1. Efficient use of expensive links: The links are assumed to be expensive and scarce. Packet switching allows many, bursty flows to share the same link efficiently. “Circuit switching is rarely used for data networks,... because of very inefficient use of the links” - Gallager 2. Resilience to failure of links & routers: ”For high reliability,... [the Internet] was to be a datagram subnet, so if some lines and [routers] were destroyed, messages could be... rerouted” - Tanenbaum
30
Univ. of TehranIntroduction to computer Network30 Some Definitions Packet length, P, is the length of a packet in bits. Link length, L, is the length of a link in meters. Data rate, R, is the rate at which bits can be sent, in bits/second, or b/s. 1 Propagation delay, PROP, is the time for one bit to travel along a link of length, L. PROP = L/c. Transmission time, TRANSP, is the time to transmit a packet of length P. TRANSP = P/R. Latency is the time from when the first bit begins transmission, until the last bit has been received. On a link: Latency = PROP + TRANSP. 1. Note that a kilobit/second, kb/s, is 1000 bits/second, not 1024 bits/second.
31
Univ. of TehranIntroduction to computer Network31 Packet Switching A R1 R2 R4 R3 B SourceDestination Host A Host B R1 R2 R3 TRANSP 1 TRANSP 2 TRANSP 3 TRANSP 4 PROP 1 PROP 2 PROP 3 PROP 4 “Store-and-Forward” at each Router
32
Univ. of TehranIntroduction to computer Network32 Packet Switching vs. Message switching Breaking message into packets allows parallel transmission across all links, reducing end to end latency. It also prevents a link from being “hogged” for a long time by one message. Host A Host B R1 R2 R3 M/R Host A Host B R1 R2 R3 M/R
33
Univ. of TehranIntroduction to computer Network33 Inter-Process Communication Turn host-to-host connectivity into process- to-process communication regardless where the process are. Give a unified view and fill gaps between what applications expect and what the underlying technology provides. Hos t Application Host Applicatio n Hos t Channel
34
Univ. of TehranIntroduction to computer Network34 IPC Abstractions 1. Request/Reply (Client-server) distributed file systems (NFS) digital libraries (web) File Transfer (FTP) Guarantee delivering data, and might protect privacy and integrity also. Common communication patterns.
35
Univ. of TehranIntroduction to computer Network35 IPC Abstractions(Cont) 2.Stream-Based- sequence or stream of bits. Video on demand: sequence of frames. Delay constrained, but can be fetched before hand. For example, a Monitor with 352 x 240 pixels and 24 bit color. (352 x 240 x 24)/8=247.5KB Assuming 30 frame per second => 7500KBps = 60Mbps video Conferencing - tightly delay bounded. VIC From Berkeley. Both application can tolerate packet loss. Questions? What functionality each channel should provide? Where the functionality has to be implemented? In the end points or in the network?
36
Univ. of TehranIntroduction to computer Network36 Reliability in the network? What Goes Wrong in the Network? Bit-level errors (electrical interference), a bit is corrupted or a burst error. Packet-level errors (congestion) Messages are delayed Messages are deliver out-of-order Third parties eavesdrop, (lost packets) Link and node failures
37
Univ. of TehranIntroduction to computer Network37 Layering Use abstractions to hide complexity and decompose to manageable components. Abstraction naturally lead to layering Alternative abstractions at each layer Request/Reply channel Message Stream channel Application programs Hardware Host-to-host connectivity
38
Univ. of TehranIntroduction to computer Network38 Layering Advantages Modularity – protocols are easier to manage and maintain Abstract functionality –lower layers can be changed without affecting the upper layers Reuse – upper layers can reuse the functionality provided by lower layers Disadvantages Information hiding – inefficient implementations
39
Univ. of TehranIntroduction to computer Network39 Protocols Building blocks of a network architecture, or layer abstraction. Each protocol object has two different interfaces service interface: operations on this protocol peer-to-peer interface: messages exchanged with peer Term “protocol” is overloaded specification of peer-to-peer interface module that implements this interface
40
Univ. of TehranIntroduction to computer Network40 Host 1 Protocol Host 2 Protocol High-level object High-level object Service interface Peer-to-peer interface Interfaces
41
Univ. of Tehran41 Protocol Machinery Protocol Graph Nodes are protocols and edges are depend on. most peer-to-peer communication is indirect peer-to-peer is direct only at hardware level Digital library application Video application RRP MSP HHP File application Host 1 Digital library application Video application RRP MSP HHP File application Host 2
42
Univ. of Tehran42 Protocol Machinery (cont) Multiplexing and Demultiplexing (demux key) Encapsulation (header/body) RRPData HHP Application program Application program Host 1 Host 2 Data RRP Data HHP Data RRP Data HHP
43
Univ. of TehranIntroduction to computer Network43 ISO OSI Reference Model ISO – International Standard Organization OSI – Open System Interconnection Started to 1978; first standard 1979 ARPANET started in 1969; TCP/IP protocols ready by 1974 Goal: a general open standard allow vendors to enter the market by using their own implementation and protocols
44
Univ. of TehranIntroduction to computer Network44 ISO Architecture Application Presentation Session Transport End host One or more nodes within the network Network Data link Physical Network Data link Physical Network Data link Physical Application Presentation Session Transport End host Network Data link Physical Telnet, FTP, TFTP MSB, integer Manage TCP streams Message, P2P(process) Packet, routing Frame, CRC Raw bit pipe The last 3 protocols are implemented in all elements in the Network.
45
Univ. of TehranIntroduction to computer Network45 Encapsulation A layer can use only the service provided by the layer immediate below it Each layer may change and add a header to data packet data
46
Univ. of TehranIntroduction to computer Network46 OSI Model Concepts Service – says what a layer does Interface – says how to access the service Protocol – Says how the communication is done and how is the service implemented a set of rules and formats that govern the communication between two peers
47
Univ. of TehranIntroduction to computer Network47 Physical Layer (1) Service: move the information between two systems connected by a physical link Interface: specifies how to send a bit Protocols: coding scheme used to represent a bit, voltage levels, duration of a bit Examples: coaxial cable, optical fiber links; transmitters, receivers
48
Univ. of TehranIntroduction to computer Network48 Datalink Layer (2) Service: framing, i.e., attach frame separators send data frames between peers others: arbitrate the access to common physical media ensure reliable transmission provide flow control Interface: send a data unit (packet) to a machine connected to the same physical media Protocols: layer addresses, implement Medium Access Control (MAC) (e.g., CSMA/CD)…
49
Univ. of TehranIntroduction to computer Network49 Network Layer (3) Service: deliver a packet to specified destination perform segmentation/reassemble others: packet scheduling buffer management Interface: send a packet to a specified destination Protocols: define global unique addresses; construct routing tables
50
Univ. of TehranIntroduction to computer Network50 Transport Layer (4) Services: provide an error-free and flow-controlled end-to-end connection multiplex multiple transport connections to one network connection split one transport connection in multiple network connections Interface: send a packet to specify destination Protocols: implement reliability and flow control Examples: TCP and UDP
51
Univ. of TehranIntroduction to computer Network51 Session Layer (5) Service: full-duplex access management, e.g., token control synchronization, e.g., provide check points for long transfers Interface: depends on service Protocols: token management; insert checkpoints, implement roll-back functions
52
Univ. of TehranIntroduction to computer Network52 Presentation Layer (6) Service: convert data between various representations Interface: depends on service Protocol: define data formats, and rules to convert from one format to another
53
Univ. of TehranIntroduction to computer Network53 Application Layer (7) Service: any service provided to the end user Interface: depends on the application Protocol: depends on the application Examples: FTP, Telnet, WWW browser
54
Univ. of TehranIntroduction to computer Network54 Internet Architecture Defined by Internet Engineering Task Force (IETF). Developed in mid 60s in the ARPANET project. No assumption about the network tech. … FTPHTTPNV TFTP TCP UDP IP NET 1 2 n
55
Univ. of TehranIntroduction to computer Network55 Internet Architecture Hourglass Design, IP is the focal point. Delivery is separated from end-to-end process channel. No restrict layering Application vs Application Protocol (FTP, HTTP) Network IP TCP UDP Application
56
Univ. of TehranIntroduction to computer Network56 OSI vs. TCP/IP OSI: conceptually define services, interfaces, protocols Internet: provide a successful implementation Application Presentation Session Transport Network Datalink Physical Internet Host-to- network Transport Application IP LAN Packet radio TCPUDP TelnetFTPDNS OSITCP
57
Univ. of TehranIntroduction to computer Network57 Performance Metrics Bandwidth (throughput) data transmitted per time unit link versus end-to-end notation KB = 2 10 bytes Mbps = 10 6 bits per second Latency (delay) time to send message from point A to point B one-way versus round-trip time (RTT) components Latency = Propagation + Transmit + Queue Propagation = Distance / C (light speed) Transmit = Size / Bandwidth
58
Univ. of TehranIntroduction to computer Network58 Bandwidth versus Latency Relative importance Latency bounded- sending 1-byte by client, 1ms vs 100ms dominates sending a message on a 1Mbps or 100Mbps link Bandwidth Bounded- sending 25MB image: 1Mbps vs 100Mbps dominates 1ms vs 100ms delayed channel. Infinite bandwidth RTT dominates Throughput = TransferSize / TransferTime TransferTime = RTT + 1/Bandwidth x TransferSize 1-MB file to 1-Gbps link the same as 1-KB packet to 1-Mbps link.
59
Univ. of TehranIntroduction to computer Network59 Delay x Bandwidth Product Amount of data “in flight” or “in the pipe” Example: 100ms x 45Mbps = 560KB We are usually more interested in 2 times of this value Since it take RTT to hear from receiver. Bandwidth Delay
60
Univ. of TehranIntroduction to computer Network60 Latency Latency ( Queuing Delay) Host A Host B R1 R2 R3 TRANSP 1 TRANSP 2 TRANSP 3 TRANSP 4 PROP 1 PROP 2 PROP 3 PROP 4 Q2Q2 The egress link might not be free, packets may be queued in a buffer. If the network is busy, packets might have to wait a long time. How can we determine the queuing delay?
61
Univ. of TehranIntroduction to computer Network61 Queues and Queuing Delay To understand the performance of a packet switched network, we can think of it as a series of queues interconnected by links. For given link rates and lengths, the only variable is the queuing delay. If we can understand the queuing delay, we can understand how the network performs.
62
Univ. of TehranIntroduction to computer Network62 Queues and Queuing Delay Cross traffic causes congestion and variable queuing delay.
63
Univ. of TehranIntroduction to computer Network63 A router queue A(t), D(t)D(t) Model of FIFO router queue Q(t)Q(t)
64
Univ. of TehranIntroduction to computer Network64 A simple deterministic model Properties of A(t), D(t): A(t), D(t) are non-decreasing A(t) >= D(t) A(t), D(t)D(t) Model of FIFO router queue Q(t)Q(t)
65
Univ. of TehranIntroduction to computer Network65 A simple deterministic model bytes or “fluid” A(t)A(t) D(t)D(t) Cumulative number of departed bits up until time t. time Service process Cumulative number of bits Cumulative number of bits that arrived up until time t. A(t)A(t) D(t)D(t) Q(t)Q(t) Properties of A(t), D(t) : A(t), D(t) are non-decreasing A(t) >= D(t)
66
Univ. of TehranIntroduction to computer Network66 D(t) A(t) time Q(t) d(t) Queue occupancy: Q(t) = A(t) - D(t). Queuing delay, d(t), is the time spent in the queue by a bit that arrived at time t, and if the queue is served first-come-first-served (FCFS or FIFO) Simple deterministic model Cumulative number of bits
67
Univ. of TehranIntroduction to computer Network67 D(t) A(t) time Q(t) d(t) Example Cumulative number of bits Example: Every second, a train of 100 bits arrive at rate 1000b/s. The maximum departure rate is 500b/s. What is the average queue occupancy? 0.1s0.2s1.0s 100
68
Univ. of TehranIntroduction to computer Network68 Queues with Random Arrival Processes 1. Usually, arrival processes are complicated, so we often model them as random processes. 2. The study of queues with random arrival processes is called Queueing Theory. 3. Queues with random arrival processes have some interesting properties. We’ll consider some here.
69
Univ. of TehranIntroduction to computer Network69 Properties of queues Time evolution of queues. Examples Burstiness increases delay Determinism minimizes delay Little’s Result. The M/M/1 queue.
70
Univ. of TehranIntroduction to computer Network70 Time evolution of a queue Packets A(t), D(t)D(t) Model of FIFO router queue Q(t)Q(t) time Packet Arrivals: Departures: Q(t)Q(t)
71
Univ. of TehranIntroduction to computer Network71 Burstiness increases delay Example 1: Periodic arrivals 1 packet arrives every 1 second 1 packet can depart every 1 second Depending on when we sample the queue, it will contain 0 or 1 packets. Example 2: N packets arrive together every N seconds (same rate) 1 packet departs every second Queue might contain 0,1, …, N packets. Both the average queue occupancy and the variance have increased. In general, burstiness increases queue occupancy (which increases queuing delay).
72
Univ. of TehranIntroduction to computer Network72 Determinism minimizes delay Example 3: Random arrivals Packets arrive randomly; on average, 1 packet arrives per second. Exactly 1 packet can depart every 1 second. Depending on when we sample the queue, it will contain 0, 1, 2, … packets depending on the distribution of the arrivals. In general, determinism minimizes delay. i.e. random arrival processes lead to larger delay than simple periodic arrival processes.
73
Univ. of TehranIntroduction to computer Network73 Little’s Result
74
Univ. of TehranIntroduction to computer Network74 The Poisson process
75
Univ. of TehranIntroduction to computer Network75 The Poisson process Why use the Poisson process? It is the continuous time equivalent of a series of coin tosses. It is known to model well systems in which a large number of independent events are aggregated together. e.g. Arrival of new phone calls to a telephone switch Decay of nuclear particles “Shot noise” in an electrical circuit It makes the math easy. Be warned Network traffic is very bursty! Packet arrivals are not Poisson. But it models quite well the arrival of new flows.
76
Univ. of TehranIntroduction to computer Network76 An M/M/1 queue If A(t) is a Poisson process with rate, and the time to serve each packet is exponentially distributed with rate , then: A(t), D(t)D(t) Model of FIFO router queue
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.