Title: CS 2200 Lecture 23 Networking
1CS 2200 Lecture 23Networking
- (Lectures based on the work of Jay Brockman,
Sharon Hu, Randy Katz, Peter Kogge, Bill Leahy,
Ken MacKenzie, Richard Murphy, and Michael
Niemier)
2Announcements
- Georgia Tech is in the Final Four
- HW 4 is due Wednesday at 1159 p.m.
- I will not have office hours this Thursday
- I am moving them from 1100 1230 on Wednesday
- (April 7th only)
- P5 is really due on Friday April 23 at 115959
p.m. since we need to grade it.
3Last timereview of mutual exclusion
- Review of Semaphores
- Explain Deadlock
- Producer/Consumer problem
- (i.e. why we need the critical section)
- An example
- Producer/Consumer with semaphores
- (note all of this is essentially covered on
page 1-3 of your handout)
4Last time intro. to hreads
- 1. What are threads why do you want em
- 2. Styles of thread programming
- intro to POSIX threads (pthreads) API
- 3. Synchronization (again)
- from point of view of programmer, not of hardware
- primitives that block instead of spin-wait
- 4. Implementation
5Last timeWhat is a Thread?
- Basic unit of CPU utilization
- A lightweight process (LWP)
- Consists of
- Program Counter
- Register Set
- Stack Space
- Shares with peer threads
- Code
- Data
- OS Resources
- Open files
- Signals
6Last timeWhy threads?
Recall from board code, data, files shared No
process context switching
- Can be context switched more easily
- Registers and PC
- Not memory management
- Can run on different processors concurrently in
an SMP - Share CPU in a uniprocessor
- May (Will) require concurrency control
programming like mutex locks.
This is why we talked about critical sections,
etc. 1st
7Last timeMulti-Threaded Operating Systems
- How widespread is support for threads in OS?
- Digital Unix, Sun Solaris, Win9x, Win NT, Win2k,
Linux, Free BSD, etc - Process vs. Thread?
- In a single threaded program, the state of the
executing program is contained in a process - In a multithreaded program, the state of the
executing program is contained in several
concurrent threads
8Last timelocks and condition variables
- A semaphore really serves two purposes
- Mutual exclusion protect shared data
- Always a binary semaphore
- Synchronization temporally coordinate events
- One thread waits for something, other thread
signals when its available - Idea
- Provide this functionality in two separate
constructs - Locks Provide mutual exclusion
- Condition variables Provide synchronization
- Like semaphores, locks and condition variables
are language-independent, and are available in
many programming enviroments
9Last timelocks and condition variables
- Locks
- Provide mutually exclusive access to shared data
- A lock can be locked or unlocked
- (Sometimes called busy or free)
- Can be implemented
- Trivially by binary semaphores
- (create a private lock semaphore, use P and V)
- By lower-level constructs, much like semaphores
are implemented
10Last timelocks and condition variables
- Example conventions
- Before accessing shared data, call
LockAcquire() on a specific lock - Complain (via ASSERT) if a thread ties to acquire
a lock it already has - After accessing shared data, call
Lock()Release() on the same lock - Example
- Thread A Thread B
- milk?Acquire() milk?Acquire()
- if(noMilk) if(noMilk)
- buy milk buy milk
- milk?Release() milk?Release()
11Last timelocks and condition variables
- Consider the following code
- QueueAdd() QueueRemove()
- lock?Acquire() lock?Acquire()
- add item if item on queue, remove item
- lock?Release() lock?Release()
- return item
-
- QueueRemove will only return an item if theres
already one in the queue
12Last timelocks and condition variables
- If the queue is empty, it might be more desirable
for QueueRemove to wait until there is
something to remove - Cant just go to sleep
- If it sleeps while holding the lock, no other
thread can access the shared queue, add an item
to it, and wake up the sleeping thread - Solution
- Condition variables will let a thread sleep
inside a critical section - By releasing the lock while the thread sleeps
13Last timelocks and condition variables
- Condition Variables coordinate events
- Example (generic) syntax
- Condition (name) create a new instance of
class Condition (a condition variable) with the
specified name - After creating a new condition, the programmer
must call LockLock() to create a lock that will
be associated with that condition variable - ConditionWait(conditionLock) release the lock
and wait (sleep) when the thread wakes up,
immediately try to re-acquire the lock return
when it has the lock - ConditionSignal(conditionLock) if threads are
waiting on the lock, wake up one of those threads
and put it on the ready list - Otherwise, do nothing
14Last timelocks and condition variables
- ConditionBroadcast(conditionLock) if threads
are waiting on the lock, wake up all of those
threads and put them on the ready list otherwise
do nothing - IMPORTANT
- A thread must hold the lock before calling Wait,
Signal, or Broadcast - Can be implemented
- Carefully by higher-level constructs (create and
queue threads, sleep and wake up threads as
appropriate) - Carefully by binary semaphores (create and queue
semaphores as appropriate, use P and V to
synchronize) - Carefully by lower-level constructs, much like
semaphores are implemented
15Last timelocks and condition variables
- Associated with a data structure is both a lock
and a condition variable - Before the program performs an operation on the
data structure, it acquires the lock - If it needs to wait until another operation puts
the data structure into an appropriate state, it
uses the condition variable to wait - (see next slide for example)
16Last timelocks and condition variables
- Unbounded-buffer producer-consumer
- Lock lk int avail 0
- Condition c
- / producer / / consumer /
- while(1) while(1)
- lk?Acquire() lk?Acquire()
- produce next item if(avail 0)
- avail c?Wait(lk)
- c?Signal(lk) consume next item
- lk?Release() avail--
- lk?Release()
-
17Last timelocks and condition variables
- Semaphores and condition variables are pretty
similar perhaps we can build condition
variables out of semaphores - Does this work?
- ConditionWait() ConditionSignal()
- sema?P() sema?V()
-
- NO! Were going to use these condition
operations inside a lock. What happens if we use
semaphores inside a lock?
18Last timelocks and condition variables
- How about this?
- ConditionWait() ConditionSignal()
- lock?Release() sema?V()
- sema?P()
- lock?Acquire()
-
- How do semaphores and condition variables differ
with respect to keeping track of history?
19Last timelocks and condition variables
- Semaphores have a value, CVs do not!
- On a semaphore signal (a V), the value of the
semaphore is always incremented, even if no one
is waiting - Later on, if a thread does a semaphore wait (a
P), the value of the semaphore is decremented and
the thread continues - On a condition variable signal, if no one is
waiting, the signal has no effect - Later on, if a thread does a condition variable
wait, it waits (it always waits!) - It doesnt matter how many signals have been made
beforehand
20Review how to wait
- (4. blocking) Proper Implementation
- scheduler data structures protected by a
spin-lock - blocking mutex implementation bootstraps on
that spin-lock
void blocking_mutex_lock(mutex_t mutex)
spin_mutex_lock(theschedulermutex) if
(mutex-gtstate 1) enqueue(running,
mutex-gtblocklist) scheduler() /
unlocks theschedulermutex / else
mutex-gtstate 1 spin_mutex_unlock(the
schedulermutex)
21Review when to waitCondition Variable
This is your lock on your data structure
pthread_mutex_t mutex pthread_cond_t cond
pthread_mutex_lock(mutex) while
(my_elaborate_condition()) pthread_cond_wait(
cond, mutex) / do stuff that depended on
condition / pthread_mutex_unlock(mutex)
This is the pcblist
block this thread call the scheduler
22Review example usagedequeue code with
cond_wait()
static void queue_dequeue(queue_t queue)
queueitem_t queueitem void item
pthread_mutex_lock(queue-gtmutex) while
(queue-gthead NULL) pthread_cond_wait(queue
-gtempty, queue-gtmutex) queueitem
queue-gthead queue-gthead queueitem-gtlink
if (queue-gthead NULL) queue-gttail NULL
pthread_mutex_unlock(queue-gtmutex) item
queueitem-gtitem queueitem_free(queueitem)
return(item)
23New StuffLets talk about Networking
- (1st part might be useful in HW)
24Overview
- A brief history (for the curiosity factor)
- An introduction and overview (helpful for HW)
- Basic Concepts
- Network Hardware
- Ethernet
- Network Protocols
- Distributed Systems
- Remote Procedure Calls (RPC)
Hopefully today.
25A Brief History
26A Brief History
- 1876 Telephone Invented
- (Analog technology)
- 1942 Mainframes Developed
- Use continues today
- Initially batch oriented environment
- Evolution to Timesharing
- i.e. Data terminals connected to mainframes
- Early 60's Voice telephony switches to digital
27A Brief History
- 1960 ATT Introduced Dataphone
- First commercial modem
- Modem Modulator/Demodulator
- Convert between digital and analog signals
- (Essentially same technology used today)
28A Brief History
- 1965 DoD Advanced Research Projects Agency (ARPA)
begins work on ARPANET - 1968/9 Carterphone decision allowed devices which
were beneficial and not harmful to the network to
be connected to the Public Switched Telephone
Network (PSTN). - Paved the way for computers to communicate using
the telephone switching infrastructure.
29A Brief History
- 1969 ARPANET connects 4 computers
- Stanford Research Institute, UCLA, UC Santa
Barbara, and the University of Utah - 1971 The ARPANET grows to 23 hosts connecting
universities and government research centers
around the country. - 1971 Intel introduces the first microprocessor -
the Intel 4004.
30A Brief History
- 1971 The Kenbak-1, the first microcomputer, is
introduced in Scientific American, selling a
total of 40 units in 2 years. - Used 130 IC's with a 256 byte memory and 8-bit
words, processed 1000 instructions per second,
and cost 750.
31A Brief History
- 1972 Intel launches the 8-bit 8008 - the first
microprocessor which could handle both upper and
lowercase characters. - 1972 Xerox develops the Xerox Alto - the first
computer to use a Graphic User Interface.
The Alto consists of four major parts the
graphics display, the keyboard, the graphics
mouse, and the disk storage/processor box. Each
Alto is housed in a beautifully formed, textured
beige metal cabinet that hints at its 32,000
price tag (1979US money). With the exception of
the disk storage/processor box, everything is
designed to sit on a desk or tabletop
32A Brief History
- 1973 Robert Metcalfe invents the Ethernet
networking system at the Xerox Palo Alto Research
Center.
33A Brief History
- 1973 The ARPANET goes international
- 1974 Intel introduces the 8080 microprocessor
- 5 times faster than the 8008.
- And the heart of the future Altair 8800.
34A Brief History
- 1975 MITS markets the Altair 8800 - the first
mass-market microcomputer, launching the Personal
Computer Revolution. - 1975 Internet operations transferred to the
Defense Communications Agency - 1975 Bill Gates and Paul Allen form the Microsoft
company to create software for the new Altair
8800.
35A Brief History
- 1976 Apple Computer is formed by Steve Jobs,
Steve Wozniak, and Ron Wayne, and launches the
Apple Computer. - 1977 Tandy Radio Shack ships its first personal
computer - the TRS-80. It sells over 10,000
units, tripling expectations. - 1977 Apple Computer launches the Apple II, which
sets new standards for sophisticated personal
computer systems.
36A Brief History
- 1978 The C programming language is completed at
ATT Bell Laboratories, offering a new level of
programming. - 1978 Apple and Tandy ship PCs with 5.25" floppy
disks, replacing cassette tape as the standard
storage medium for PCs. - 1978 Hayes Microcomputer Products releases the
first mass-market modem, transmitting at 300 bps
(0.3K).
37A Brief History
- 1978 Intel ships the Intel 8086 microprocessor,
with 29,000 transistors, and running at 4.77
megahertz. - 1979 Personal Software creates VisiCalc for the
Apple II, the first electronic spreadsheet
program, selling over 100,000 copies. - 1979 Intel develops the 8088 microprocessor,
which would later become the heart of the IBM PC.
38A Brief History
- 1979 Motorola develops the Motorola 68000
microprocessor, offering a new level of
processing power. - 1980 Seagate Technology introduces the first
microcomputer hard disk, capable of holding 5
megabytes of data. - 1980 Philips introduces the first optical laser
disk, with many times the storage capacity of
floppy or hard disks.
39A Brief History
- 1980 Xerox creates Smalltalk - the first
object-oriented programming language. - 1980 John Shoch at Xerox creates the first worm
program, with the capacity to travel through
networks. - 1981 Ungermann-Bass ships the first commercial
Ethernet network interface card.
40A Brief History
- 1981 Xerox introduces the Xerox Star 8010, the
first commercial Graphic User Interface computer,
for 16,000-17,000. - 1981 Microsoft supplies IBM with PC-DOS (which it
would also sell as MS-DOS), the OS that would
power the IBM PC. - 1981 IBM brings to market the IBM PC, immediately
establishing a new standard for the world of
personal computers.
41A Brief History
- 1981 ARPANET has 213 hosts. A new host is added
approximately once every 20 days. - 1982 The term 'Internet' is used for the first
time. - 1983 TCP/IP becomes the universal language of the
Internet
42http//research.lumeta.com/ches/map/
43Basic stuff
- (Which should be helpful for your HW)
443 kinds of networks
- Massively Parallel Processor (MPP) network
- Typically connects 1000s of nodes over a short
distance - Often banks of computers
- Used for high performance/scientific computing
- Local Area Network (LAN)
- Connects 100s of computers usually over a few kms
- Most traffic is 1-to-1 (between client and
server) - While MPP is over all nodes
- Used to connect workstations together (like in
Fitz) - Wide Area Network (WAN)
- Connects computers distributed throughout the
world - Used by the telecommunications industry
45Some basics
- Before we go into some specific details, we need
to define some terms - Done within the context of a very simple network
- sending something from Machine A to Machine B
each connected by unidirectional wires - A lot of this may be review for some of you but
just bear with me for a bit
Machine A
Machine B
46A Simple Example Revisted
- What is the format of packet?
- Fixed? Number bytes?
Address/Data
CRC
Code
2 bits
32 bits
4 bits
00 RequestPlease send data from Address 01
ReplyPacket contains data corresponding to
request 10 Acknowledge request 11 Acknowledge
reply
47Simple Example SoftwareHW kernel-controlled,
memory-mapped
- Send steps
- 1 Application copies data to OS buffer, does a
system call - 2 OS computes checksum, copies data/checksum to
NI HW - 3 OS sets timeout timer, tells NI to start
- SW Receive steps
- 1 OS copies data from hardware to OS buffer,
performs checksum - 2 If checksum matches send ACK if not, OS
deletes message (sender resends when timer
expires) - 3 If OK, notify application application copies
data from OS buffer - Sequence of steps protocol
- Example similar to UDP/IP protocol in UNIX
48Some basics prepping a message
- If Machine A wants data from Machine B, it 1st
must send a request to B with the address of the
data it wants - Machine B must then send a reply with the data
- Again, overhead starts to raise its ugly head
- In this simple case we need extra bits of data to
detect if message is a new request or a reply to
a request - Kept in header or footer usually
- Software is also involved with the whole process
- How?
49What does the software do?
- Well, for starters, its everywhere
- Software must translate requests for reads and
replies into messages that the network can handle - A big reason is processes
- Network is shared by 2 computers with different
processes - Must make sure right message goes to right
process OS does this - This information can be/is included in the header
more overhead
50What does the software do?
- Software also helps with reliability
- SW adds and acknowledges a checksum added to a
message - Makes sure that no bits were flipped in
transmission for example - Also makes messages not lost in transit
- Often done by setting a time if no
acknowledgement by time x, message is resent
51Sending and receiving a message SW
- Sending a message
- Application copies data to be sent into an OS
buffer - OS will
- Calculate a checksum, put it in header/trailer,
start time - OS sends data into network interface HW and tells
HW to send
52Sending and receiving a message SW
- Receiving a message (almost the reverse of
sending) - System copies data from NW interface HW into OS
buffer - System checks checksum field
- If checksum OK, receiver acknowledges receipt
- If not, message deleted (sender resends after a
time) - If data OK, copy data to user address space done
- What about the sender?
- If data is good, data deleted from buffer it
time-out, resend
53Performance parameters (see board)
- Bandwidth
- Maximum rate at which interconnection network can
propagate data once a message is in the network - Usually headers, overhead bits included in
calculation - Units are usually in megabits/second, not
megabytes - Sometimes see throughput
- Network bandwidth delivered to an application
- Time of Flight
- Time for 1st bit of message to arrive at receiver
- Includes delays of repeaters/switches length /
m (speed of light) (m determines property of
transmission material) - Transmission Time
- Time required for message to pass through the
network - size of message divided by the bandwidth
54Performance parameters (see board)
- Transport latency
- Time of flight transmission time
- Time message spends in interconnection network
- But not overhead of pulling out or pushing into
the network - Sender overhead
- Time for mP to inject a message into the
interconnection network including both HW and SW
components - Receiver overhead
- Time for mP to pull a message out of
interconnection network, including both HW and SW
components - So, total latency of a message is
55Performance parameters (see board)
56An example (see board)
57An example (see board)
58Bisection bandwidth
- A popular measure for MPP connections
- Calculated by dividing all of the interconnect of
a machine/system into 2 equal parts - Each part has ½ of the nodes
- Then, sum the bandwidth of the lines that cross
the imaginary dividing line - For example
- For fully connected interconnections, the
bisection bandwidth is (n/2)2 (n of nodes) - Problem not all interconnection are symmetric
- Solution pick the worst possible configuration
- We generally want a worst-case estimate
59Some more odds and ends
- Note from the example (with regard to longer
distance) - Time of flight dominates the total latency
component - Repeater delays would factor significantly into
the equation - Message transmission failure rates rise
significantly - Its possible to send other messages with no
responses from previous ones - If you have control of the network
- Can help increase network use by overlapping
overheads and transport latencies - Can simplify the total latency equation to
- Total latency Overhead (Message
size/bandwidth) - Leads to
- Effective bandwidth Message size/Total latency
60Network Performance Measures
- Overhead latency of interface vs.
- Latency latency of network
61Example Performance Measures
62There is an old network saying Bandwidth
problems can be cured with money. Latency
problems are harder because the speed of light is
fixed--you cant bribe God.
David Clark, MIT
63A Quick Review
- (Media)
- (Then well talk about how we use it to send
messages, the protocols needed, etc. etc.)
64Network Media
- There are different ways to connect computers
together - Can kind of think of it like a memory hierarchy
- Different kinds of media vary in cost,
performance, and reliability - There are several different kinds well consider
- Twisted Pair
- Coaxial Cable
- Fiber Optics
- Air
- (first, see board for summary discussion)
65Twisted pair media
- Just a twisted pair of copper wires
- Insulated, about 1mm thick
- Twisted together to reduce electrical
interference - Makes sure we dont turn it into an antenna!
- Data transfer speeds of
- A few Mbs over a few kilometers 10s of Mbs over
shorter distances - Uses
- Used lots in the telephone industry
- OK for LANs because of reasonable data transfer
rates
66Coaxial (coax) cable
- A picture of it is included below
- Consists of copper center surrounded by
insulator, a mesh, and a plastic coating - Originally developed for cable companies to
transmit at a higher rate over a few kms - Good bandwidth 50 ohm coax cable can deliver 10
Mbs over a kilometer - Good for LAN
67Coax cable junctions
- Its harder to connect things to this media
however - One method is the T-junction
- The typical way this is handled
- Cable cut in 2 and a connector is inserted that
reconnects the cable and adds a 3rd wire to the
computer - But, if you add a new connector, you have to
split the network and therefore bring it down for
a short period of time - Additional maintenance is a headache b/c any user
can disconnect the network - Better the vampire tap
- Drill a hole to terminate in the copper core
- Screw in connector no cable cut, no network
down time
68Fiber optics
- Replaces copper with plastic and electrons with
photons - Information is now transmitted via pulses of
light - Usually, 3 basic components
- Transmission medium fiber optic cable
- Light source LED or laser diode
- Light detector photodiode
- A simplex media data can only go in 1 direction
- How it works
69Fiber optics how it really works
- Because light is bent/refracted at interfaces, it
can slowly spread out as it travels down the
diameter of a cable - Unless that is we transfer a single wavelength of
light - Then itll travel in a straight line
- With this in mind, let consider the 2 kinds of
fiber optic cable - Multimode Fiber
- Allows light to be dispersed
- Uses inexpensive LEDs
- Useful for transmissions of about 2 kms 600 Mbs
in 1995 - Single-mode Fiber
- A single-wavelength fiber
- Uses more expensive laser diodes as light sources
- Transmits Gbs over 100s of kms great for phone
companies!
70Fiber optics practical issues
- Single mode fiber is a better transmitter but
more difficult to attach connectors - Also, less reliable, more expensive, cant bend
as much - Usually in LAN, multimode is the weapon of
choice - So, how do you connect fiber optics to a
computer? - Passive Mode
- Taps are fused into the fiber and a photodiode
looks at passing light - Electrical output passes to the computer
interface - A failure cuts off just 1 computer
- Active Mode
- Really a break in the cable
- Light converted to electrical signals, sent to
computer, converted back to light, sent back down
cable - Problem tap failure causes net failure
- Advantage light source refreshed, can go longer
distances
71Some comparisons
72Connecting multiple computers
73Connecting Multiple Computers
- Finish basics routing and topologies
- Example Ethernet
- Protocols I
- concept of layers
- abstraction mechanisms encapsulation,
fragmentation - Example TCP/IP on ethernet
- Protocols II
- algorithms
74Connecting Multiple Computers
- Shared Media vs. Switched pairs communicate at
same time point-to-point connections - Aggregate BW in switched network is many times
shared - point-to-point faster since no arbitration,
simpler interface - Arbitration in Shared network?
- Central arbiter for LAN?
- Listen to check if being used (Carrier Sensing)
- Listen to check if collision (Collision
Detection) - Random resend to avoid repeated collisions not
fair arbitration - OK if low utilization
75Switched vs. shared
Node
Node
Node
Shared Media (Ethernet)
Node
Node
Switched Media (ATM)
(A. K. A. data switching interchanges,
multistage interconnection networks, interface
message processors)
Switch
Node
Node
76Switch topology
- Switch topologyreally just a fancy term for
describing - How different nodes of a network can be connected
together - Many topologies have been proposed, researched,
etc. only a few are actually used - MPP designers usually the most creative
- Have used regular topologies to simplify
packaging, scalability - LANs and WANs more random
- Often a function of what equipment is around,
distances, etc. - Two common switching organizations
- Crossbar
- Allows any node to communicate with any other
node with 1 pass through an interconnection - Omega
- Uses less HW (n/2 log2n vs. n2 switches) more
contention
77(others) crossbar vs. omega
Crossbar
Omega
78(others) Fat-tree topology
Squares switches, squares processor-memory
nodes
Higher bandwidth, higher in the tree match
common communication patterns
79(others) Ring topology
- Instead of centralizing small switching element,
small switches are placed at each computer - Avoids a full interconnection network
- Disadvantages
- Some nodes are not directly connected
- Results in multiple stops, more overhead
- Average message must travel through n/2 switches,
n nodes - Advantages
- Unlike shared lines, ring has several transfers
going at once
Example of a ring topology
80(others) Dedicated communication links
- Usually takes the form of a communication link
between every switch - An expensive alternative to a ring
- Get big performance gains, but big costs as well
- Usually cost scales by the square of the number
of nodes - The big costs led designers to invent things in
between - In other words, topologies between the cost of
rings and the performance of fully connected
networks - Whether or not a topology is good typically
depends on the situation - Some popular topologies for MPPs are
- Grids, tours, hypercubes
81(others) Topologies for commercial MPPs
2D grid or mesh of 16 nodes
2D tour of 16 nodes
Hypercube tree of 16 nodes (16 24, so n 4)
82Bisection bandwidth (revisited)
- A popular measure for MPP connections
- Calculated by dividing all of the interconnect of
a machine/system into 2 equal parts - Each part has ½ of the nodes
- Then, sum the bandwidth of the lines that cross
the imaginary dividing line - For example
- For fully connected interconnections, the
bisection bandwidth is (n/2)2 (n of nodes) - Problem not all interconnection are symmetric
- Solution pick the worst possible configuration
- We generally want a worst-case estimate
83Practical issues with topologies
- 3D drawings have to be mapped to chips
- This is easier said than done
- Different layers of metal in VLSI/CMOS circuits
help give you added dimensions but only so much - Reality things that should work perfectly
theoretically dont really work in practice - What about the speed of a switch?
- If its fixed, more links/switch less
bandwidth/link - Which could make a topology less desirable
- Latency through a switch depends on complexity of
routing pattern which depends on the topology
84Connection-Based vs. Connectionless
- Telephone operator sets up connection between
the caller and the receiver - Once the connection is established, conversation
can continue for hours - Share transmission lines over long distances by
using switches to multiplex several conversations
on the same lines - Time division multiplexing divide B/W
transmission line into a fixed number of slots,
with each slot assigned to a conversation - Problem lines busy based on number of
conversations, not amount of information sent - Advantage reserved bandwidth
85Connection-Based vs. Connectionless
- Connectionless every package of information must
have an address gt packets - Each package is routed to its destination by
looking at its address - Analogy, the postal system (sending a letter)
- also called Statistical multiplexing
- Note Split phase buses are sending packets
86Routing Messages
- Shared Media
- Broadcast to everyone!
- Switched Media needs real routing. Options
- Source-based routing message specifies path to
the destination (changes of direction) - Virtual Circuit circuit established from source
to destination, message picks the circuit to
follow - Destination-based routing message specifies
destination, switch must pick the path - deterministic always follow same path
- adaptive pick different paths to avoid
congestion, failures - randomized routing pick between several good
paths to balance network load
87Deterministic Routing Examples
- mesh dimension-order routing
- (x1, y1) -gt (x2, y2)
- first ?x x2 - x1,
- then ?y y2 - y1,
- hypercube edge-cube routing
- X xox1x2 . . .xn -gt Y yoy1y2 . . .yn
- R X xor Y
- Traverse dimensions of differing address in order
- tree common ancestor
110
010
111
011
100
000
101
001
88Routing Policies
- Store and Forward
- Wormhole
- http//www.johnlockhart.com/research/janet/
89Store and Forward vs. Cut-Through
- Store-and-forward policy each switch waits for
the full packet to arrive in switch before
sending to the next switch (good for WAN) - Cut-through routing or worm hole routing switch
examines the header, decides where to send the
message, and then starts forwarding it
immediately - In worm hole routing, when head of message is
blocked, message stays strung out over the
network, potentially blocking other messages
(needs only buffer the piece of the packet that
is sent between switches). - Cut through routing lets the tail continue when
head is blocked, accordioning the whole message
into a single switch. (Requires a buffer large
enough to hold the largest packet). - See board
90Summary of Basicsa bottom-up view so far
- Messages
- Networking media
- Routing messages through switches
- Example Ethernet (next)
- Following that top-down view
- applications want more than isolated messages
- protocol concepts
- example TCP/IP on ethernet
91Example Ethernet
A drawing of the first Ethernet system by Bob
Metcalfe.
92Ethernet Evolution
- X_Base_Y
- X stands for the available media bandwidth
- Base stands for base band signaling on the medium
- Y stands for the maximum distance a station can
be from the vampire tap (i.e. Length of Attach
Unit Interface)
93Ethernet Evolution
- 10_base_5 (1979-1985)
- 10 Mbits/Sec with base band signaling with a
maximum station distance of 500 meters - Thick shielded copper conductor used as the medium
MAU-Medium Access Unit
94- 10_base_2 (1985-1993)
- Thin net, cheaper net
- Distance to the station shrinks to 200 meters
- No more vampire taps
- BNC connector to connect the stations to the
Attach Unit Interface (AUI) cables, the AUI
cables to the medium - The medium is daisy-chained via the stations
using the BNC connectors
Bayonet Neil-Concelman, or sometimes British
Naval Connector
95- 10_base_T (1993-1995)
- Attach Unit Interface (AUI) is a twisted pair of
copper wires - AUIs from the stations come to a hub (a kind of
repeater) - Did away with the BNC connectors which were a
source of connector problems - Use phone jack technology (RJ45 connectors) to
connect AUI cables to the hub - Hubs are connected to other hubs using
- the same connectors (RJ45)
96- 10_base_T (1993-1995) continued
- All the hubs together form the entire medium
- All the stations in the same collision domain
- Hub is also usually called a repeater
97More Ethernet (FYI)
- 10BROAD36 - 10BROAD36
- a seldom used Ethernet specification which uses a
physical medium similar to cable television, with
CATV-type cables, taps, connectors, and
amplifiers. - 1BASE5 - 1BASE5
- a specification of Ethernet that runs at 1 Mb/s
over twisted pair wiring. This physical topology
uses centralized hubs to connect the network
devices. - FOIRL - Fiber Optic Inter-Repeater Link
- This specification of the 802.3 standard defines
a standard means of connecting Ethernet repeaters
via optical fiber.
98More Ethernet (FYI)
- 10BASE-F - 10BASE-F
- a set of optical fiber medium specifications
which define connectivity between devices. - 100BASE-T - 100BASE-T
- a series of specifications that provides 100
megabit speeds over copper or fiber. These
topologies are often referred to as Fast
Ethernet. - Gigabit Ethernet - Gigabit Ethernet
- provides speeds of 1000 Mb/s over copper and
fiber.
99Where will it end???
100Broadband vs. Baseband
- A baseband network has a single channel that is
used for communication between stations. Ethernet
specifications which use BASE in the name refer
to baseband networks. - A broadband network is much like cable
television, where different services communicate
across different frequencies on the same cable. - Broadband communications would allow a Ethernet
network to share the same physical cable as voice
or video services. 10BROAD36 is an example of
broadband networking.
101Current Technology
- Most modern Ethernet networks use twisted pair
copper cabling or fiber to attach devices to the
network. The 10BASE-T, 100BASE-T, and Gigabit
Ethernet topologies are well suited for the
modern cabling and fiber infrastructures.
102Still Hungry?
- http//www.faqs.org/faqs/LANs/ethernet-faq/
103Ethernet
- The various Ethernet specifications include a
maximum distance - What do we do if we want to go further?
- Repeater
- Hardware device used to extend a LAN
- Amplifies all signals on one segment of a LAN and
transmits them to another - Passes on whatever it receives (GIGO)
- Knows nothing of packets, addresses
- Any limit?
104Repeaters
R1
R2
R3
105Repeaters
R1
R2
R3
106Bridges
- We want to improve performance over that provided
by a simple repeater - Add functionality (i.e. more hardware)
- Bridge can detect if a frame is valid and then
(and only then) pass it to next segment - Bridge does not forward interference or other
problems - Computers connected over a bridged LAN don't know
that they are communicating over a bridge
107Bridges
- Typical bridge consists of conventional CPU,
memory and two NIC's. - Does more than just pass information from one
segment to another - A bridge can be constructed to
- Only pass valid frame if necessary
- Learn what is connected to network "on the fly"
108Bridges
- A bridge will connect to distinct segments
(usually referring to a physical length of wire)
and transmit traffic between them. - This allows you to extend the maximum size of the
network while still not breaking the maximum wire
length, attached device count, or number of
repeaters for a network segment.
109Ethernet vs. Ethernet w/bridges
Node
Node
Node
Node
Node
Node
Node
Node
Node
Node
Node
Single Ethernet 1 packet at a time
Node
Node
Node
Node
Node
Node
Bridge
Bridge
Node
Node
Node
Node
Node
Multiple Ethernets Multiple packets at a time
110Switch
A
B
C
D
111Virtual LANs
- VLANs may span bridges
- Nodes 1 and 5 same VLAN 2, 6, 7 same VLAN
- All nodes on the same VLAN hear broadcasts from
any node on that VLAN - VLAN limits the traffic flow among bridges
- A hierarchical network with only bridges results
in a switched ethernet with no collisions!
112http//www.cisco.com/univercd/cc/td/doc/product/so
ftware/ios113ed/113ed_cr/switch_c/xcvlan.htm
113Network Interface Card
- NIC
- Sits on the host station
- Allows a host to connect to a hub or a bridge
- If connected to a hub, then NIC has to use
half-duplex mode of communication (i.e. it can
only send or receive at a time) - If connected to a bridge, then NIC (if it is
smart) can use either half/full duplex mode - Bridges learn Media Access Control (MAC) address
and the speed of the NIC it is talking to.
114Routers
- Work much like bridges
- Pay attention to the upper network layer
protocols - (OSI layer 3) rather than physical layer (OSI
layer 1) protocols. - Will decide whether to forward a packet by
looking at the protocol level addresses (for
instance, TCP/IP addresses) rather than the MAC
address.
115Routers
- Because routers work at layer 3 of the OSI stack,
it is possible for them to transfer packets
between different media types (i.e., leased
lines, Ethernet, token ring, X.25, Frame Relay
and FDDI). Many routers can also function as
bridges.
116Routers
- Repeaters and Bridges understand only Media
Access Control (MAC) addresses - Traffic flow between nodes entirely based on MAC
addresses - Packet from a host station ltmac-addr, payloadgt
- Routers understand IP addresses
- Special board that sits inside a bridge
- IP layer on all nodes send packets destined
outside the LAN to the router - Router sees a packet as ltip-hdr, payloadgt
- uses the ip-hdr to route the packet on to internet
117Protocols ILayering
118Why we need them?
- Enable sharing the hardware network links
- Overcome sources of unreliability in the network
- Lost packets
- Temporary failure of an intervening routing node
- Mangled packets
- Reflections on the media, soft errors in
communication hardware buffers, etc. - Out of order delivery
- Packets of the same message routed via different
intervening nodes leading to different latencies
119Recall
- A protocol is the set of rules used to describe
all of the hardware and (mostly) software
operations used to send messages from Processor A
to Processor B - Common practice is to attach headers/trailers to
the actual payload forming a packet or frame.
120Layers
- Protocol design is described by using layers.
- Logically communication occurs at each level!
Known as peer-to-peer communication - Its like this...
121Be all that you can be
- General B receives message from General A
- Colonel unpackages message and passes to General
B - Major unpackages messages and passes to Colonel B
- Captain unpackages message and passes to Major B
- Lieutenant unpackages message and passes to
Captain B - Sergeant unpackages message and passes to
Lieutenant B - Private receives message, unpackages it and
passes it to Sergeant B
- General A sends message to General B
- Colonel A repackages and sends to Colonel B
- Major A repackages and sends to Major B
- Captain A repackages and sends to Captain B
- Lieutenant A repackages and sends to Lieutenant B
- Sergeant A repackages and sends to Sergeant B
- Private A takes message, steals motorcycle and
delivers message to Private B
122Be all that you can be
- General B receives message from General A
- Colonel unpackages message and passes to General
B - Major unpackages messages and passes to Colonel B
- Captain unpackages message and passes to Major B
- Lieutenant unpackages message and passes to
Captain B - Sergeant unpackages message and passes to
Lieutenant B - Private receives message, unpackages it and
passes it to Sergeant B
- General A sends message to General B
- Colonel A repackages and sends to Colonel B
- Major A repackages and sends to Major B
- Captain A repackages and sends to Captain B
- Lieutenant A repackages and sends to Lieutenant B
- Sergeant A repackages and sends to Sergeant B
- Private A takes message, steals motorcycle and
delivers message to Private B
Note Message Identical at this point
123Protocol Family Concept
Message
Message
Message
124Why layers?
- Good abstraction
- Simpler to understand than OGP
- Easier to design, analyze, implement and test
- Design concept is suites or families
125What is a Minimal Protocol
- Bridge applications notion of message to the
networks notion of a packet - Application layer
- Hands over application programs message to the
transport layer - e.g. rtp_send and rtp_recv of PRJ5
Ghosts of Future Homework
126Remember
- You make a call in your application.
- You think youre sending a message to another
computer - Whats really happening?
127What is a Minimal Protocol
- Transport layer
- e.g. RTP layer in Project 5
- At sending end
- Takes a message from the application layer and
breaks it into packets commensurate with the
network characteristics - Attaches headers to the packets that contain
information for use at the destination - Handles retransmissions if necessary for
overcoming network errors
128What is a Minimal Protocol
- Transport layer (continued)
- At receiving end
- Use the header info to assemble a message
destined for an application program at this node - Keeps track of packets of message(s) being
assembled - Negotiate with the sender (using ACKS/NACKS) to
complete the message assembly - Hand over assembled message to the application
layer
129What is a Minimal Protocol
- Network layer
- Implements the network driver to deal with the
physical characteristics of the network - e.g.
- CSMA/CD for Ethernet
- token re-generation for token ring
- Routing packets on the available network links
- Filtering packets on the network and snarfing
those intended for this node
130Protocol Layering
- Do we need these three layers?
- Do we need any more layers?
- What does the layering mean?
- How rigid is the layering?
- Does layering imply inefficiency?
131Layering Advantages
- Layering allows functionally partitioning the
responsibilities (similar to having procedures
for modularity in writing programs) - Alows easily integrating (plug and play) new
modules at a particular layer without any changes
to the other layers - Rigidity is only at the level of the interfaces
between the layers, not in the implementation of
these interfaces - By specifying the interfaces judiciously
inefficiencies can be avoided
132Why not combine transport network?
133- Separation of transport and network is good
- Allows the networking layer to decide the best
path to take from source to destination - Addition/removal of physical media does not
affect the transport layer code - Are these three layers sufficient?
- Consider a node that wants to talk with other
nodes that may be on local LAN as well as other
nodes in the outside world - Now we can generalize the layered protocol
model...
134ISO Model
7
- Interact with user e.g. mail, telnet, ftp
Presentation
- Char conv., echoing, format diffs endian-ness
6
Session
- Process to process comm. e.g. Unix sockets
5
Transport
- Packetizing, seq-num, retrans. e.g. TCP, UDP
4
Network
- Routing, routing tables e.g. IP
3
- Interface to physical media, error recovery e.g.
retransmit on collision in Ethernet
Data Link
2
- Electrical and mechanical characteristics of
physical media e.g. Ethernet
Physical
1
135ISO Model Examples
7
Presentation
6
Session
- Sockets open/close/read/write interface
5
Transport
- TCP reliable infinite-length stream
4
Network
- IP unreliable datagrams anywhere in
world
3
- Ethernet unreliable datagrams on local segment
Data Link
2
- 10baseT ethernet spec twisted pair w/RJ45s
Physical
1
136ISO Model Examples
7
User program
Presentation
6
Session
- Sockets open/close/read/write interface
5
Kernel Software
Transport
- TCP reliable infinite-length stream
4
Network
- IP unreliable datagrams anywhere in
world
3
- Ethernet unreliable datagrams on local segment
Data Link
2
Hardware
- 10baseT ethernet spec twisted pair w/RJ45s
Physical
1
137Packet or Frame
Layer 7 header
Layer 6 header
Layer 5 header
Layer 4 header
Layer 3 header
Layer 2 header
138Practical Aspects of Layering
- OSI model only a historic guide
- Arpanet days
- With the evolution of Internet
- Some layers got collapsed
- These days...
- Layers 7-5 ftp, telnet, smtp, ..
- Layer 4 TCP, UDP
- Layer 3 (with aspects of 2) IP
- Layer 2 and 1 Ethernet bridges/repeaters
139Layering Summary
- Key to protocol families is that communication
occurs logically at the same level of the
protocol, called peer-to-peer, - but is implemented via services at the next lower
level - Encapsulation carry higher level information
within lower level envelope - Fragmentation break packet into multiple smaller
packets and reassemble - Danger is each level increases latency if
implemented as hierarchy (e.g., multiple check
sums)
140Layering SummaryTCP atop IP atop Ethernet
- Application sends message
- TCP breaks into 64KB segments, adds 20B header
- IP adds 20B header, sends to network
- If Ethernet, broken into 1500B packets with
headers, trailers (24B)
- All Headers, trailers have length field,
destination, ...
141Be all that you can be
- http//www.cc.gatech.edu/TA-app
Application deadline (summer/fall) Thursday,
April 15, 2004 8AM. Eligibility Criteria for
being a UTA in the College of Computing A or B
in the course you want to TA for Good academic
standing 2.5 Overall GPA 3.0 CS/ECE Major GPA
Sophomore, Junior, Senior, or Graduate Student
Standing No record of academic or computer
misconduct
142Protocols IIAlgorithms
143Techniques Protocols Use
- Sequencing for Out-of-Order Delivery
- Sequencing to Eliminate Duplicate Packets
- Retransmitting Lost Packets
- Avoiding Replay Caused by Excessive Delay
- Flow Control to Prevent Data Overrun
- Mechanism to Avoid Network Congestion
- Name Resolution (external to protocol really)
144Sequencing for Out-of-Order Delivery
- Will packets arrive in the same order they were
sent? - Why?/Why not?
- Solution
- Attach sequence number to packet
- Maintain counter
- If arriving packet is next sequence pass it on
- If not save until correct point
145Sequencing to Eliminate Duplicate Packets
- Can packets be duplicated?
- Transmitter sends packet
- Thinks collision occurs, backs off
- Resends packet
- Solution
- Use sequence numbers to detect and discard
duplicates