240 likes | 356 Views
Lecture Topics: 11/27. Networks Layered Model Ethernet IP. What is a network?. A network allows computers to communicate There are lots of different views of a network System Area Network (computers in the same room) Local Area Network (computers in the same building)
E N D
Lecture Topics: 11/27 • Networks • Layered Model • Ethernet • IP
What is a network? • A network allows computers to communicate • There are lots of different views of a network • System Area Network (computers in the same room) • Local Area Network (computers in the same building) • Wide Area Network (computers on the same planet) • All basically the same idea: one computer sends another computer a message
What is a protocol? • A protocol is a common standard that determines how two machines communicate • Many different types of protocols • low level (transfer bits between two connected machines, e.g. Ethernet) • middle level (transfer bits between two unconnected machines, e.g. IP) • high level (do something useful, e.g. HTTP get a web page)
OSI Layered Network Model • Layering of protocols is good • enforces modularity (easier to make changes) • layers don’t need to know details of higher or lower layers • Physical layer • getting raw bits from one node to another • coaxial, fiber optics, wireless • Data link layer • groups bits together to transmit between nodes on a network • Ethernet, PPP, SLIP • Network layer • transmits packets between networks (IP) • Transport layer • sequencing and acknowledgment of received data (UPD,TCP) • Application layer • telnet, Internet Explorer
Application Data TCP Header Application Data IP Header TCP Header Application Data TCP Segment IP Header TCP Header Application Data IP Datagram Ethernet Header Ethernet Checksum Ethernet Frame Protocol Stack • These layers comprise the protocol stack • Each layer of the stack adds extra info to the packet Application layer Transport layer Network layer Data link layer
IP Header TCP Header Application Data Destination Address Source Address Type Ethernet Packets • Ethernet header includes • the network address of the source and destination • hardwired and globally unique • the type of the packet (e.g. IP or ARP) • Ethernet checksum used to detect errors • is a hash of the entire packet • when a packet is received the hash is checked with the CRC 6 bytes 4 bytes CRC Ethernet Header Ethernet Checksum Ethernet Frame
Ethernet • Protocol defining how to send packets within a LAN (local area network) • Developed at Xerox PARC in early ’70s • Packet based, distributed administration • A broken node does not affect the network • CSMA/CD (Carrier Sense, Multiple Access, Collision Detection) • Basic idea: • Wait for line to become quiet • While transmitting, check if someone else was transmitting • If someone else was transmitting, stop and wait before retransmitting
A B C Multiple Access • All nodes are connected to the same shared wire • All nodes receive all packets • A destination address distinguishes • addresses are 48 bits and are globally unique • Example: If A sends a packet, it is received by both B and C
A B C A B C A B C Carrier Sense • Nodes can sense when the wire is being used • A node waits to send if someone else is sending B wants to send, but can’t b/c A is sending A finishes sending B can send after A is finished • What’s the problem?
B and C want to send, but can’t b/c A is sending A finishes sending B and C both send at the same time A B C A B C A B C B and C detect that there was a collision A B C Collision Detection • Nodes detect if there are multiple senders
After Collision Detection B and C jam the Ethernet to make sure all nodes see the collision A B C B and C wait a random amount of time before sending again A B C C happens to wait less time and sends first A B C B waits for C to finish and then sends A B C
A A B B C C A A A B B B C C C A B C A B C Multiple Collisions B and C detect a collision and jam Ethernet B and C wait a random amount of time Random[0,WaitTime] B and C happen to collide again B and C double the amount of time to wait Random[0,2*WaitTime] B happens to send first C waits for B to finish and then sends
A B A B A B A A B B Minimum Packet Size • Sender cannot sense a collision if packets are too small A and B send small packets at the same time A and B stop sending before detecting a collision The packets are corrupted, but neither sender knows • Min packet must be twice the max propagation delay A can send for one propagation delay without B sensing it A must send for another propagation delay before sensing that B caused a collision
Determining Minimum Size • The minimum packet size depends on • length of the Ethernet (1 km) • speed of the signal (km/sec) • bits sent per second (Mbits/sec) • For 10Mbit Ethernet, the minimum packet size is 64 bytes
Maximum Packet Size • Ethernet uses a maximum packet size of 1500 • only for fairness, so nodes don’t have to wait indefinitely to send a packet
Ethernet Evaluation • Ethernet had many key ideas that have spread to other layers of the protocol • decentralized control • exponential backoff • best effort—no guarantees that a packet would be delivered • There are other data link protocols, why did Ethernet win? • biggest competitor was token rings, • allowed bandwidth to be shared fairly • one machine’s failure caused the entire network to fail
Internet History • Goal: effective use of existing networks • minimal support from underlying networks • packet switching • routers connecting networks • Other goals: • survive hardware failure • support multiple types of apps • run on wide variety of networks • distributed management of resources • cost-effective • low cost host attachment • Internet hugely successful because of it can run on anything
Survivability • Internet approach • Cheap, failable components • Stateless routers + self-healing • Keep routing simple (non-adaptive) • End to end recovery • Telephone approach • Ultra reliable switches • Self-healing
IP • Ethernet allows packets to be sent between nodes on the same network • Internet Protocol (IP) allows packets to be sent between nodes on different networks • Key idea: some machines (i.e. routers) are on multiple networks • Ethernet is still used to send packets between routers
IP Routers Routers send packet to next closest point H R H R H H R R R R R H R H: Hosts R: Routers H
IP Addresses • IP addresses are 4 bytes (e.g. 128.95.8.137) • part of the address designates the network (e.g. 128.95) • the rest of the address designates the machine on the network (e.g. 8.137) • A router sends the packet to the correct network, and the network sends the packet to the correct node • this greatly reduces the information a router must store
How do routers know where to send packets? • Forwarding tables at each router • Network == 128.95, then send to router X • Original Internet: manual update • Now: automatic update based on “cost” • exchange tables with neighbors • use neighbor with smallest hop count • what if node says zero cost to everywhere?
Setting up Routing Tables • Graph theory to compute “shortest path” • routers = nodes • links = edges • delay, hops = cost • Need dynamic computation to adapt to changes in topology • if a router goes down, might need to find another path
IP Routing Protocols • There are two basic kinds of routing protocols • Distance Vector • exchange routing tables with neighbors • no one knows complete topology • now used between admin domains (i.e. AT&T and MCI • Link state • tell everyone who your neighbors are • everyone computes shortest path • now used within admin domains (within AT&T)