Class 26 CS 439 18 April 2013 --------------- [lecturer: Sebastian Angel] 1. Networks 2. Layers 3. Physical Layer 4. Link Layer 5. Network Layer 6. ARP 7. Big picture What are some examples of a network? - Social, Railroad, Computer, Phone 5 Layers +-----------+ | App | +-----------+ | Transport | +-----------+ | Network | +-----------+ | Link | +-----------+ | Phys | +-----------+ Physical Layer: ================ - Determines how bits are represented on a given medium. -- Medium: Material in which to propagate signals. e.g., Coaxial cable, fiber, radio, twisted pair (ethernet) -- Signal: Voltage change, presence of photons, electromagnetic waves. -- Modulation and De-modulation - Determines how the physical topology is arranged. -- Direct connection -- Repeaters -- Extends the physical medium -- Hubs -- Allows machines to think that they are part of the same medium -- Point to point medium -> shared transmission medium --> e.g., Logically it makes it seem as if all machines are connected to the same fiber cable - Transmission time is bounded by the speed of light. -- Delay: Distance / Speed of Light -- RTT = 2 * Delay (assumes no computation) [CA to NY example] -- So, how come we hear in the news that connections are getting faster?? --- Bandwidth: number of bits per second. - The physical layer determines how bandwidth is used. -- Broadband -- Just like cable TV. Have different frequencies or "channels" that carry different transmissions. -- Baseband -- All available frequencies are used to carry a transmisison. - How to support multiple flows (application data) -- Different channels (Frequency Division Multiplexing) -- Time division multiplexing (TDMA) Link Layer ============ 2 Sublayers: Logical Link Control: - Makes it possible for multiple network protocols to coexist. - Provides point-to-point flow control (we'll see flow control again at the network and transport layer). Medium Access Control (MAC): - Controls communication over a shared access medium. - Goal: prevent collisions. What are collisions? How can they happen? - Provides an addressing mechanism. - Deliver messages to the right device. Data unit: Frames - Especially tailored to the particular medium. Ethernet MAC ------------- Frame = [ Preamble (8) | Header (14) | Data | CRC ] Header = [ Destination (6) | Source (6) | Type (2) ] Where do MAC addresses come from? - Assigned to manufacturers who install them in their products - Special addresses for broadcast and multicast MAC protocol: -- CSMA/CD (Carrier Sense, multiple access, collision detection). -- Carrier Sense: Don't transmit if someone else is. -- Multiple Access: Handle multiple transmitters. -- Collision Detection: If there is collision, data will be corrupted; use a random backoff and try again. Note: For this to work you _must_ transmit for an entire RTT, so that others can detect collision. -- This places a limit on the maximum end-to-end extent and minimum frame size. -- Need to transmit enough data to cover an entire RTT. -- Need to be close enough, so that we can assign a reasonable RTT. -- Max cable length is 100 meters. -- Due to signal degradation. Vanilla Ethernet (10 Mbps) - Max end-to-end distance is 2.5 kilometers. - Min frame size: 64 bytes (RTT = 5 kms / 1.25 x 10^5 = 40 us 10 Mbps * 40 us = 400 bits = 50 bytes) FastE (100 Mbps) - Max distance: 200 meters. - Min frame size: 64 bytes GigE (1 Gbps) - Max distance: 200 meters. - Min frame size: 512 bytes. -- Issues with Ethernet - Limited number of nodes (1024) - Distance limits - Forwarding state doesn't scale How to address distance? -- Switches -- Create "virtual" point-to-point networks -- Have state that can be used to determine in which interface to send frames. How do switches know which interface to send data in? - Forwarding table: [ Destination : Port/ Link ] -- Destination is a "physical" MAC address -- Populated based on previous interactions or manually. -- If an entry is not in the table, broadcast data frame in all links. - Why is this not a good fit for the Internet? -- Too many addresses. Imagine how large forwarding tables would need to be. -- We also need a naming that works for all types of media! Network layer ============== Data unit: Packet Protocols: IP, AppleTalk, Xerox's IDP (Internet Datagram), Novell's IPX (Internet Packet Exchange). Internet Protocol (IP) -- Logical addresses -- IP is used to connect multiple networks -- Most computers speak IP -- Designed for end-to-end delivery Packet header: 14 fields (13 are required, thought not all are actually used). -- Hierarchical: -- IP address divided into network address and host address. -- Assigned by the Internet Assigned Numbers Authority Example: UT receives from IANA 128.62.*.* (128.62.0.0/16) First 16 bits represent network address (UT). Remaining 16 represent host address. - UT is assigned (2^(32-16)) or 65K addresses that it can delegate to users (e.g., departments, staff, etc). -- Think of street names, city names, country. [See Example] -- WAN: Multiple LANs are connected together by Routers. -- [Draw IP routing, and why it's scalable] -- Not enough IP addresses for everyone... what can be done? -- Network address translation. -- Example of trying to ssh to a machine behind a home router. -- Putting things together: Example 1: Server | (Subnet 1) - R - H - R - (Subnet 2) | R | WAN => Server can monitor all traffic. Address Resolution Protocol (ARP) ================================= How does the OS determine which ethernet address to put given an IP address? -- If destination host physically connected, use its MAC address -- Otherwise, use MAC address of next router (given IP address) -- Either way, OS maps IP addresses into physical addresses. -HOW? ARP! ARP: -- Broadcast request for MAC address of the destination IP address -- "who-has" message. -- Target machine responds with MAC address. -- OS keeps ARP cache with IP-->MAC address mappings -- Periodically discards entries -- type "arp -a" to see contents of arp cache. Example 2: -- Routing to a machine at UT [draw the topology] hop-by-hop