lecture topics: 11/27
DESCRIPTION
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) - PowerPoint PPT PresentationTRANSCRIPT
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
Protocol Stack
• These layers comprise the protocol stack• Each layer of the stack adds extra info to the
packet
Application Data
IP Header Application DataTCP HeaderEthernet Header
Ethernet Checksum
Ethernet Frame
IP Header Application DataTCP Header
IP Datagram
Application DataTCP Header
TCP Segment
Application layer
Transport layer
Network layer
Data link layer
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
IP Header Application DataTCP HeaderEthernet Header
Ethernet Checksum
Ethernet Frame
Destination Address
Source Address
Type
6 bytes
CRC
4 bytes
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
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
Carrier Sense• Nodes can sense when the wire is being used• A node waits to send if someone else is sending
A B C
A B C
A B C
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?
Collision Detection
• Nodes detect if there are multiple senders
A B C
A B C
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 CB and C detect that there was a collision
After Collision Detection
A B C
A B C
A B CB and C jam the Ethernet to make sure all nodes see the collision
B and C wait a random amount of time before sending again
C happens to wait less time and sends first
A B CB waits for C to finish and then sends
Multiple CollisionsB and C detect a collision and jam Ethernet
A B C
A B C
A B C
A B C
A B C
A B C
A B C
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
Minimum Packet Size
• Sender cannot sense a collision if packets are too small A B
A B
A B
A and B send small packets at the same timeA and B stop sending before detecting a collision
The packets are corrupted, but neither sender knows
• Min packet must be twice the max propagation delayA B A B
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
R
R
R
RRHH
H
H
H
R
RH
R
Routers send packet to next closest point
H: Hosts
R: Routers
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)