Lecture Notes for 4/5/05 WAN (Wide-area network) - A WAN consists of point-to-point links. Examples of these links are leased phone lines, RS232 connections, T1 and T2 lines, regular phone calls, satelline links, and others. The Internet is a WAN. Network Topologies - Networks can either be fully connected or partially connected. - In fully connected networks, every site can talk directly to any other site. An example of this would be Usenet. - In partially connected networks, not every site can talk directly to every other site. - The most popular ones today are star and ring networks. In these, intermediate nodes must forward messages from the receiver to the sender (more on ring later). - Another example is the multi-access bus (switch)/broadcast which is used by most LANs today. A single cable (or group of cables) connects many machines together. An example of this is Ethernet. Another is radio braodcast. Network Performance Parameters - Network performance is usually characterized in terms of two performance parameters, latency and bandwidth. - Latency is the minimum time it takes to get the smallest possible amount of information between two sites. - This minimum amount of information is usually one bit. - Transmission latency is the time it takes a given bit from one end to the other once the connection is set up. - Set-up latency is the time it takes for the first bit to get from the sender to the receiver. In other words, it adds to transmission latency the time it takes to set up the connection. - Bandwidth is the measure of how much information can transfer from the sender to the receiver per unit time. (The marginal cost per bit). Measured in bits/second. In other words, latency is how "long" your wire is. Bandwidth is how "thick" it is. Q: What is the highest bandwidth we have nowadays (in a laboratory, not commercially)? A: Over fibers, on the order of 100 GB/s. Bandwidth over fibers basically is limited by the blinking rate of the signalling laser and the sensing laser. These days, companies increase bandwidth over existing fibers by sending data over different frequencies in the fiber. Thus, bandwidth is multiplied many times over the same wire (as opposed to using just one frequency). Protocols: - Networks are based upon protocols, or how we talk. Protocols are an agreement between parties on the network about how information will be transmitted between them and what the information format is. - Protocols are like languages, some are better, some are worse, most work. Like languages, the one that gets used is basically a matter of politics rather than the actual quality of the various protocols. - Many different protocols for different things: (mail, FTP, SSH). Protocols are usually built up in layers. Read Section 15.6 of the book for the 7 ISO protocol layers. - Heirarchical protocols relate different layers in the same system (network system, operating system) - Peer-to-peer protocols relate the same layer on different systems. System 1 System 2 +--------------+ +--------------+ | | | | +--------------+ +--------------+ | | | | +--------------+ +--------------+ | ^ | | | +-------|------+ +--------------+ | v | | | | heirarchical | | | | protocol | | | +--------------+ peer-to-peer protocol +--------------+ | | <--------------------------------------> | | +--------------+ +--------------+ | | | | +--------------+ +--------------+ | | | | +--------------+ +--------------+ ISO Protocols (the layers from lowest to highest) 1) Physical layer: Basically the electrical mechanisms of the system. This can be difficult; for example, trying to determine whether a bit is a 1 or a 0 given imperfect square waves. 2) Data link layer: Describes how to get packets between two directly connected components. This includes error correction from the physical layer (detection and recovery). 3) Network layer: Takes care of routing and addressing. Gets packets from here to there in some way, using some route (perhaps immediate routing). 4) Transport layer: Where the network starts to look like a network. Breaks messages into packets. Makes sure that packets aren't sent faster than they can be received (flow rate). Keeps the packets in order. Re-transmits lost and damaged packets. 5) Session layer: process-to-process protocols. 6) Presentation layer: resolves differences between sites in formats (e.g. character types, number representation, full/half duplex, etc.) 7) Application layer: interacts with users. Supports electronic mail, distributed data bases, etc. - Layers 5, 6, and 7 are usually mushed together. - WANs are usually made up of LANs. LANs are usually some sort of broadcast network. - A broadcast network uses a single, shared communication medium. It cannot control access to itself (anybody can listen in, just like radio). - The simplest broadcast network is the Aloha network (based in Hawaii). It used satellites to broadcast between the various islands. - Disadvantages of Aloha: Really bad. 1/2e (18%) chance of getting a message through the system. Collapses under heavy loads. - Since Aloha used satellite, it had horrible delays (1/4 second). Fortunately, that kept people from listening to others. - Slotted Aloha was a method used to increase bandwidth. In slotted Aloha, messages must be contained within slots of time. In regular Aloha, messages could start anytime, creating more collisions between messages. Slotted Aloha reduces collisions between messages, and thus doubles bandwidth (1/e). Ethernet - Uses a simple coax cable that runs to everyone. - Ethernet is named after the "ether", a substance that physicists theorized went everywhere (in Ethernet, messages go everywhere in the wire) - Faster than satellite. This also means that people can easily tap the line and listen for messages. - Now senders can listen, wait for the line to be clear, then broadcast. (carrier sense) - Allows listening while broadcasting. Collisions can still occur between two stations transmitting at the same time. If a collision occurs, jam the network so that everyone can know about the collision. - CSMA/CD (carrier sense multiple access with collision detection) Q: Is is possible for two machines to try to send a message, collide, wait for exactly the same amount of time, try to send, wait for the exact amount of time...and so on and so forth? A: No, messages get sent after a "random" interval in case of collision. Repeated collisions result in longer and longer waits. Ethernet Frame: - Destination address (6 bytes). This is 2^48 addresses, more than enough. - Source address (6 bytes). - Type (2 Bytes) (allows for different versions of packets) - Data (46-1500 bytes). - Frame check (4 bytes) Error detection. (Not correction, since Ethernet resends on error). Problems with Ethernet - If any station jams the network, nobody can do anything. People can't even find out who's doing it. - There's no guarantee against starvation. (FCFS). - Bandwidth is limited to cable (10 Mbits) - Original ethernet was limited to a physical cable (4000 feet). - Longer wires = more transmission time, which leads to more collision. - Relatively easy to listen to all traffic, and/or tap cable. Recent Ethernet Designs - Use a switch to route, rather than a shared cable. - Higher bandwidth rates. - Wireless ethernet (802.11) - Frame format, timeouts, and collision detection are all the same. Ring network - A ring network is a type of broadcast network. --X-- / \ X X \ / X---X The X's represent sites. Messages are sent from the sender to the receiver in one direction. (both directions in doubly linked ring networks) - An electronic token packet is circulated throughout the ring at high speed. If a station is not broadcasting, it transmits everything it receives to the next machine. (Each machine has a FIFO queue of messages to send) - When a station wants to broadcast, it waits for the token packet. Once it receives it, it takes the token packet out of circulation, and broadcasts its own message instead. - When the receiver sees the message, it acknowledges the message with a bit. When the sender sees its own message with the bit activated, it takes the message out and generates a new token packet. Problems with Ring Networks - If any station dies, the ring is broken. (If any two stations die in a doubly linked ring, it is broken) - If the token packet somehow goes missing, the network is broken. - Starvation is possible. - If a second token is somehow introduced, the system will act strangely. Methods for linking between machines - There are three methods for linking between machines: - Circuit switching. This works like a TRADITIONAL telephone system. There is a wire from the sender to the central station. An operator at the central system connects that wire to a receiver. There is an actual physical connection from senders to receivers. - Packet switching. Communications are broken down into packets and sent piece by piece. This looks like a virtual circuit if disassembly, transmittance, and reassembly is fast enough. - Message switching. A virtual circuit exists long enough to complete a message. After the message is transmitted, the circuit is dropped. The same theory can be used with physical links. Names vs. addresses vs. routes: - A name is a symbolic term for something. - An address is where something is. In an internetwork connections, this usually consiss of the network number, the number of the site in the network, and the id of the host at the site. - A route is a set of directions to get from here to there. - Routes used to be specified by the sender. Doing physical routing yourself is a pain. - Better if the internetwork can figure out the route itself. This is usually done with routing tables. In the past, routing tables were small enough tthat machines could store entire routing tables; nowadays, hosts build partial routing tables to nearby neighbors. - In LANs, only gateways need to worry about routing. Every other host just ships packets to the gateway. Communications Problems - Packets can get lost. - Addresses can get corrupted, making packets wander the network forever. - Hosts can drop packets if their packet buffers are full (happens when packets arrive quickly on a fast network, but must be transferred to a slower network). - Receivers can be down. - Packets' contents can get corrupted. - Packets can arrive out of order if some hosts drop, or if routing tables change. - Packets usually contain a time-to-live field so that they are killed after a certain time if they are wandering aimlessly. Datagram protocols - Used to deliver individual packets. Packets are not guaranteed to get through or to arrive in any particular order. This is useful for some applications, but not very many. (Gaming comes to mind). - Level 3 on ISO protocols. Connections - A connection basically guarantees proper delivery of packets between a sender and a receiver (in-order, no dropping) - Protocols used to implement connections are called virtual circuit or transport protocols. - Senders and receivers must remember state about what has been happening. - Ex: Simple acknowledgement-based protocol: 1) Each packet has a serial number (marked by the sender). 2) Sender sends a group of (one or more) packets. 3) Receiver sends an acknowledgement packet for each packet or group of packets. 4) Sender waits for acknowledgement before sending the next group of packets. Old packets are saved 5) If sender doesn't receive acknowledgement within a certain amount of time, it assumes the packet was lost and resends it. If the recevier receives duplicates of the same packet, it throws away the duplicate and out-of-order packets. 6) Sender and receiver must negotiate about how far ahead the sender can send. Otherwise, the receiver might run out of buffer space and have to discard packets (this is the flow control problem) TCP/IP - TCP/IP is collection of network protocols making up the Internet Protocol Suite. - History: 1969- Arpanet with 4 nodes. (SDC, UCSB, UCLA, SRI) 1972- Arpanet Demo (50 hosts) mid-1970s- TCP developed, running on Unix (DEC PDP-11) early 1980s- Berkeley Unix. Runs TCP. 1983- Arpanet converts to TCP/IP. In use by Sun. ISO Levels: - Level 3 - Network Layer: - IP - Internet Protocol - Provides host-to-host datagram delivery. - Provides packet routing - Insulates higher levels from network specific characteristics like packet size. - Packet header fields: - Version (useful so that we can create new protocols and still be able to translate old protocols) - Header Length - Total length - ID - Time-to-live - Checksum - Source address - Destination address - IP address - Only 32 bits, which is starting to become a problem since we're running out of address space. - ICMP: Internet Control Message Protocol - Used by gateways and hosts to approve other hosts of conditions related to their IP services. (e.g. routing, congestion) - ARP: Address Resolution Protocol - Maps an IP address to an associated ethernet address. (32 bits -> 48 bits). - RARP: Reverse ARP - Maps an ethernet address to an associated IP address. - Level 4 - Transport Layer - TCP - Transmission Control Protocol: connection oriented, reliable, byte-stream protocol. - TCP packet header fields: - source port - destination port - sequence number (32 bits) - acknowledgement number, - control flags (SYN (connection request), ACK, RST (reset), FIN (end)) - window size - number of packets will be accepted - checksum. - Provides means to connect with a socket [IP address, port number]. - Takes care of timeouts, retransmissions, flow control. - Some well known ports: 20, 21 (FTP), 23 (Telnet), 25 (SMTP) - UDP - User Datagram Protocol - Unacknowledged transaction-oriented protocol parallel to TCP. - Levels 5-7 - Session, Presentation and Application Layers: - SMTP- Simple Mail Transfer Protocol - DNS - Domain Name Service- maps names to addresses - FTP - File Transfer Protocol - Telnet - provides virtual terminal services.