Part 3: Packet Switching and Gail Hopkins Local Area Networks (LANs): Packets, Frames and Technologies Gail Hopkins Introduction Circuit Switching vs. Packet Switching LANs and shared media Star, bus and ring topologies Packets and frames Control data and byte stuffing Circuit Switching A communication mechanism that establishes a path between sender and receiver Guaranteed isolation from paths used by other senders and receivers Usually associated with telephone technology Now use electronic devices to establish circuits Circuit Switching (2) Each circuit doesn t necessarily correspond to a physical path Multiple circuits can be multiplexed over shared media Virtual Circuit Circuit Switched Paradigm Three general properties: Point-to-point communication Separate steps for circuit creation, use and termination Performance equivalent to an isolated physical path 1
Packet Switching Main alternative to circuit switching Forms the basis for the Internet Uses statistical multiplexing Communication from multiple sources competes for use of shared media Packet Switching (2) A packet switching system requires the sender to divide each message into blocks of data packets This is the main difference between packet switching and other forms of statistical multiplexing The size of a packet varies, depending on the packet switching technology Different technologies have different maximum sizes Packet Switched Paradigm Three general properties: Arbitrary, asynchronous communication No set-up required before communication begins Performance varies due to statistical multiplexing among packets Advantages of Packet Switching Helps in detecting transmission errors Gives fair access for a shared connection between many computers An Example of Fair Access A wants to send a 5 megabyte file to C A B B wants to send a 10 kilobyte file to D 5000000x8 = 40000000bits 40000000/56000=714s /60 = 11.9 min 1000 byte packet shared resource 8000/56000=0.143s network speed is 56,000 bits per second 10000x8 = 80000bits 80000/56000=1.43s C D Packets and Time Division Multiplexing computer 1 computer 2 computer 3 computer 1 computer 2 computer 3 multiplexing occurs Packet networks use a form of TDM (a) (b) Computer 1 using channel to send a packet Computer 2 using channel to send a packet 2
Local and Wide Area Networks Shared Communication Channels Packet switching technologies commonly classified according to the distance they span Name Expansion Description LAN Local Area Network Least expensive; spans a single room or building MAN Metropolitan Area Network Medium expense; spans a major city WAN Wide Area Network Most expensive; spans sites in multiple cities Shared LANs invented in the 1960s Rely on computers sharing a single medium Computers coordinate their access Low cost But not suitable for wide area - communication delays inhibit coordination Locality of reference LANs now connect more computers than any other form of network The reason LANs are so popular is due to the principle of locality of reference physical locality of reference - computers more likely to communicate with those nearby temporal locality of reference - computer is more likely to communicate with the same computers repeatedly LAN Topologies LANs may be categorised according to topology computers connected to network star hub Part 32 Packet Transmission Switching and LAN Topologies (2) Connection from one computer to another ring Bus (shared cable) mesh bus Pros and Cons of Different Topologies Star is more robust but hub may be a bottleneck Ring enables easy coordination but is sensitive to a cable being cut Bus requires less wiring but is also sensitive to a cable being cut 3
Disadvantages of Meshes Poor scalability (a) (b) Links = N 2 N 2 Example Bus Network: Ethernet (non-switched) Single coaxial cable - the ether - to which computers connect IEEE standard specifies details data rates maximum length and minimum separation frame formats electrical and physical details (c) Conceptual Flow of Ethernet Data Sending computer transmits bits of a frame Ethernet Cable (shared bus) Destination computer receives a copy of each bit Signal propagates along the entire cable Transmitter has exclusive use of the medium Example Mesh Network Mobile Ad-Hoc Network (MANET) Type of Ad-Hoc network Self configuring Each node has to discover the topology of its network Announces its presence and listens for broadcasts from neighbouring nodes Learns from these broadcasts about nearby nodes and how to reach them May send broadcasts itself about nodes it can reach Mobile Ad-Hoc Network (MANET) Each computer can act as a router Computers can connect to each other via multiple hops Self healing Can still operate when links are broken Has to deal with mobility issues Example Use of MANET Vehicular Ad-Hoc Network (VANET) Node is electronic device in car Can receive and relay messages from other devices, e.g. traffic information Differs from typical MANET Nodes (cars) tend to move in an organised fashion Follow roads Node movement can be characterised 4
Part 32 Packet Transmission Switching and Example Star Network - ATM fibre carrying data to switch ATM switch (electronic) ATM switch computers attached to switch computer fibre carrying data to computer Asynchronous Transfer Mode Uses pairs of optical fibers to connect computers to a central hub Packet Identification, Demultiplexing, MAC Addresses In packet switching systems, demultiplexing uses an identifier known as an address Each computer is assigned a unique address IEEE has created a standard for addressing Each packet contains the address of the intended recipient Addresses and Network Interface Hardware To ensure each address is unique, IEEE allocates an address for each piece of network interface hardware Network Interface Card (NIC) in PC contains a unique IEEE address assigned when device was manufactured Address Type Unicast Broadcast Multicast Types of Addresses Meaning and Packet Delivery Uniquely identifies a single computer, and specifies that only the identified computer should receive a copy of the packet Corresponds to all computers, and specifies that each computer on the network should receive a copy of the packet Identifies a subset of the computers on a given network, and specifies that each computer in the subset should receive a copy of the packet Addressing In the IEEE addressing scheme, each address consists of 48 bits Aka Media Access Control address (MAC address) The term Ethernet address is also used by networking professionals, because 48-bit addresses originated with Ethernet technology Destination address contained in a header in each packet Packets and Hardware Frames Each type of hardware defines its own format/wrapping for a packet called a frame Packet is logical Frame is actual In a packet-switched network each frame corresponds to a packet Frame has two conceptual parts: Header contains metadata, e.g. An address Payload contains data being sent 5
Part 32 Packet Transmission Switching and A Simple Example of Framing header block of data in frame (payload) A frame may include unused control data values to mark both its beginning and end Advantage is error detection: transmitter crashes => will not arrive receiver crashes => marks next valid frame Disadvantages: requires two extra characters per frame cannot carry arbitrary values (e.g, and ) Byte Stuffing So control characters can be included in data Reserve a special character to mark the occurrence of control characters Transmitter scans data block and replaces all occurrences of control characters. Receiver performs the reverse mapping. Character in data Characters sent esc x esc y esc esc z An Example of Byte Stuffing esc Frame before byte stuffing (a) esc z esc x esc y esc z (b) Frame after byte stuffing esc Summary Circuit switching technologies Packet switching and LANs LAN topologies Packets and Frames Byte stuffing Reading: Chapter 13, Computer Networks and Internets, Comer, 5 th Edition, 2009 6