320 likes | 341 Vues
Chapter 1: Foundation. Computer Networks. (a). (b). Connectivity. Two or more computers connected directly by some physical medium. Physical medium is link ; computers it connects are nodes . Physical links types: Point-to-point: connects 2 nodes
E N D
Chapter 1: Foundation Computer Networks
(a) (b) Connectivity • Two or more computers connected directly by some physical medium. • Physical medium is link; computers it connects are nodes. • Physical links types: Point-to-point: connects 2 nodes Multiple-access: connects multiple nodes ( usually limited geographical distance)
Switched Networks • Each switch (node) is attached to one or more point-to-point links. • Network can be defined recursively: • Switches (inside cloud) implement network • Hosts (outside cloud) use network
Switched Networks: Internetwork • Internetwork: Set of connected networks (possibly different types). • Router: A node that is connected to two or more networks • Routing: process of determining how to forward messages towards destination based on address. • Address: Byte string that identifies a node. Usually unique. • Types of address: • Unicast: node-specific. • Broadcast: all nodes on the network. • Multicast: some subsets of the nodes on the network.
Switching & Forwarding 3.2 E.g. of protocol graph 3.3 E.g. of a switch • A switch connects to a number of links. • For each link runs appropriate data link protocol to communicate with the node at the other end of the link. • Primary job of switch : Receive incoming packets on one link and re transmit them on another link -> switching or forwarding. • In OSI architecture this is the main function of network layer.
Switching and Forwarding • How does a switch decide which output to place a link on ? Answer: It looks at the header -> details vary. 3 main approaches : • Source Routing : less common but simplest • Virtual circuit or connection-oriented approach. • Datagram or connectionless approach.
Workstation Architecture Each node connects to network via network adaptor A software module running on the computer (device driver) manages the adaptor Packets are buffered in memory while waiting to be transmitted. Memoryshould be managed carefully and memory access minimized as much as possible
Implementation and Performance • Simple switch: general purpose computer with a no. of network interfaces. The switch receives packets and sends them out on appropriate link. • Assume the computer has DMA (direct memory access) • When packet in memory, CPU examines header to determine output port, then uses DMA to move packet to appropriate interface. • Performance limited because all packets must • Cross I/O bus device and • be written to and read from main memory once.
Implementation and Performance • maximum aggregate throughput is: • ½ memory bw or ½ I/O bus bw, whichever is less (usually I/O bus bw). • For many applications, this is too slow • If packets are small cost of processing each packet – parsing header and deciding output link – will dominate.
Example • A switch can process 15000 packets /sec. If avg. packet size is 64 bytes, what is the throughput? • Throughput = 15000 x64x 8 = • 7.68 Mbps -> quite low. • Also this 7.68 Mbps bw is shared by all users connected to switch. • Solution: specialized switch designs - decrease contention, increase aggregate throughput. E.g. data for different outputs and arriving on different inputs can be processed in parallel.
Cost-Effective Resource Sharing • Must share network resources (nodes and links) among multiple users use multiplexing
Multiplexing • Common Multiplexing Strategies: • Time-Division Multiplexing (TDM): • Divide time into equal-sized units • Use round robin give each flow a chance to send. • Frequency-Division Multiplexing (FDM). • Different frequency signals for different destinations. • Both TDM and FDM are limited in two ways: • Amount of the time link is idle can be very large. • Maximum number of flows is fixed and known.
■ ■ ■ Statistical Multiplexing • Time division, but on demand rather then fixed. • Reschedule link on a per-packet basis • Packets from different sources interleaved on link. • Buffer packets that are contending for the link. • Packet queue may be processed FIFO, but not always. • Buffer overflow is called congestion.
What goes wrong in network ? • Bit-level errors (electrical interference). • Packet-level errors (congestion). • Link and node failures. • As a consequence • Messages are delayed. • Messages are delivered out-of-order. • Third parties eavesdrop. • Key problem: fill in the gap between what applications expect and what the underlying technology provides.
Performance • Bandwidth (throughput): amount of data transferred per unit time. E.g. 10 Mbps • Notation: KB = 210 bytes MBPS = 106 bits per second • Bandwidth related to “bit width”. 1Mbps (each bit 1 microseconds wide) 2Mbps (each bit 0.5 microseconds wide)
Performance: Latency (delay) • Latency (delay): time it takes to send message from point A to point B e.g. 24 ms • Sometimes round-trip time (RTT) more important. • Components of latency: • Latency = Propagation + Transmit + Queue • Propagation = Distance/SpeedOfLight • Transmit = Size / Bandwidth • Speed of light • 3.0 * 108 meters/second in vacuum • 2.3 * 108 meters/second in a cable • 2.0 * 108 meters/second in a fiber
Performance: Latency (delay) • No queuing delay in direct link network • Bandwidth not relevant if size=1 bit • Switching overhead(contribute to process to process latency) can dominate if distance is small. • Relative importance of bandwidth and latency • Small message (e.g.,1 byte): delay (1ms vs 100ms) dominates bw (1Mbps vs 100Mbps) • Large message (e.g., 25MB): bw (1 Mbps vs 100Mbps) dominates delay (1ms vs 100ms).
Example Example1: Size=1byte, RTT=1ms BW=1Mbps Transmit=8x10-6=8μs Total Latency=1.008ms If BW=100Mbps Transmit= 8/(100x106)=0.08μs ∴Total latency =1.00008ms independent of BW If RTT=100ms Total latency =100.008ms (1Mbps) & 100.00008ms (100Mbps)
Example Example2: Size=2kB, RTT=1ms, BW=1Mbps Transmit time=2x210x8/106=16ms Total Latency = Transmit+RTT =16ms+1ms=17ms Transmit time dominates If BW = 100Mbps Transmit time= 2x210x8/100x106 =0.16ms Total Latency = Transmit+RTT=1.16ms If RTT=100ms Total Latency = Transmit+RTT=100.16ms ∴ RTT dominates
Your Turn … Size=1MB, RTT=1ms, BW=1Mbps: Transmit= 8x106/106=8sec Total =8.001sec If RTT=100ms->8.1sec If BW=10Mbps: Transimit=8x106/10x106=0.8sec Total=0.801sec. If RTT=10ms-> Total=0.81sec ∴BW dominates for large size
Performance:Delay x Bandwidth Product • Channel between a pair of process as a hollow pipe • Latency corresponds to length of pipe • Bandwidth as diameter of pipe • ∴Product of delay x BW as volume of pipe: • number of bits it can hold
Delay X Bandwidth Example : A channel has 1 way latency=50ms and BW=45x106bps: delay x BW=50x 10-3x 106 x 45=2.25x106 ∴It can hold 2.25x106 bits =280kB (approx.) • DelayxBW is important, because it corresponds to how many bits sender must transmit before 1st bit arrives at receiver. • 2xdelayxBW is the number of bits sent before getting ACK of data
Layering and Protocols • Layering:2 nice features • Decomposes the problem of building a network into manageable components. • Provides more modular design • To provide a new service change functionality of 1 layer and reuse functions in all other layers
Layering and Protocols • Can have multiple abstractions at any given level, each providing a different service to higher levels and using the same service of lower levels
Layering and Protocols • Each Protocol has 2 different interfaces: • Service interface to other object on same computer that wants to use its services • A peer interface to its counterpart on another machine.This defines the form and meaning of the messages exchange between peers.
Host 1 Host 2 Digital Digital Video Video File File library library application application application application application application Layering and Protocols • Except at hardware level peer to peer communication is indirect • Message passed to lower-level protocol which communicate with its peer and so on.
Encapsulation • A protocol receives a message form a high level protocol and attaches a header (a data structure of a few to few dozen bytes). • Header sends control information to its peer on a different host • Data being transmitted called the massage body or payload • This data is encapsulated in the new massage.
Encapsulation • Trailer : Control information at end of message instead of begin • A low level protocol does not interpret the message it is receives from a high level protocol • Does not know how to extract meaning from the data in the message. • May apply Transformation • Compress • Encrypt • Transformation applied to entire message it receives from high level protocol
OSI Architecture • Open system interconnection develop by ISO • Gives a reference model for a protocol graph
OSI Architecture • The reference model consists of 7 layers: • Physical: handles transmission of raw bits over link • Data link:collects streams of bit in groups called frame • Frames (not raw bits) delivered to hosts • Network: handles routing among nodes in a packet switched network • Unit of data exchanged are packets not frames • Transport: Implement process to process channel. Exchange messages (not packets).
OSI Architecture 5. Session: Provide a name space to tie together different transport stream in a single “session” • Video and audio in teleconferencing • Presentation: Concerned with format of data exchange • Integer: 16 bits or 32 bits. Last bit transmitted • Application: Actual applications • FTP, email etc
HTTP NV TFTP FTP UDP TCP IP NET NET NET ■ ■ ■ 1 2 n Internet Architecture • 1st Layer: Different type of networks • Ethernet, FDDI, ATM • 2nd Layer: IP-Supports interconnect of multiple networks technologies into single logical inter network • 3rd Layer: TCP,UDP • Provides log channels to applications