Internet Architecture and Protocol Hayder Al-Ghanimi University of Babylon

advertisement
University of Babylon
College of Information Technology
Department of Software
Internet Architecture and
Protocol
Hayder Al-Ghanimi
Protocols and layering
• Network protocols and software
• Layered protocol suites
• The OSI 7 layer model
• Common network design issues and
solutions
What is a protocol
• A protocol is an agreement on how to
communicate
• Includes
– Syntax: how a communication is specified &
structured
• Format, order messages are sent and received
• Semantics: what a communication means
– Actions taken when transmitting, receiving, or when a
timer expires
– Timing: when and how long
Examples of Protocols in Human
Interactions
• Telephone
1. (Pick up / open up the phone.)
2. Listen for a dial tone / see that you have service.
3. Dial.
4. Should hear ringing …
5. Callee: “Hello?”
6. Caller: “Hi, it’s Hayder….”
Or: “Hi, it’s me” (¬ what’s that about?)
7. Caller: “Hey, do you think … blah blah blah …” pause
8. Callee: “Yeah, blah blah blah …” pause
9. Caller: Bye
10. Callee: Bye
11. Hang up
Examples of Protocols in Human
Interactions
• Asking a question
1. Raise your hand.
2. Wait to be called on.
3. Or: wait for speaker to pause and vocalize
The need for protocols
• Basic communication hardware can transfer
bits from one place to another
• Communication software provides a
convenient high level interface for application
programmers
– do not have to deal directly with hardware
– can run over different hardware
• A set of rules for exchanging messages is a
network protocol
Protocol suites
• Rather than having a single huge protocol,
protocols tend to be structured as suites of
specific protocols
– design and testing is easier
– extension and updating is easier
– selection and combination becomes possible
Layering
• The most common approach to designing
protocol suites
• Each layer deals with a different level of
abstraction and communicates with the layers
above and below
Example - the OSI 7 layer model
•
•
•
•
ISO model for standardising all networks
Now 20 years old and woefully out of date
Probably too complex
However, still provides useful terminology and
a good general example of layering
The 7 OSI layers
Conceptual path of data
Commercially available stacks
Multiple nested headers
• Each layer places information in a header
before passing a packet to a lower layer and
removes it before passing it to an upper layer
Layering principle
• Layer N software on the destination
computer must receive exactly the
message sent by layer N software on the
sending computer
Common networking issues
•
•
•
•
•
•
Sequencing for out-of-order delivery
Sequencing to remove duplicate packets
Re-transmitting lost packets
Avoiding replay caused by excessive delay
Flow control to prevent data overrun
Mechanisms to avoid network congestion
Sequencing for out-of-order delivery
• Connectionless network with dynamic routing
may deliver packets out of order
• Transport protocols solve this with sequencing
• Each packet is given a sequence number
• The receiver notes the number of the last
packet that arrived in sequence and stores
additional out of order packets
• The packets are delivered in sequence to the
next layer up
Sequencing to reject duplicates
• Malfunctioning hardware can produce
multiple copies of a packet
• Sequence numbers allow duplicates to be
detected and discarded
Re-transmitting lost packets
• Packet loss is a fundamental problem due
to transmission errors
• One approach to reliable transmission
involves positive acknowledgements
– sender transmits and starts a timer
– receiver receives and acknowledges
– on time-out the sender transmits again
– the receiver must watch out for duplicates
Avoiding replay caused by delay
• A duplicate packet might turn up in a later
session (e.g., if it was queued in a switch for a
long time)
• May be confused with a packet from the later
session that uses the same sequence number
• Solution is to include a session identifier in
the packet
Flow control to prevent overrun
• Data overrun occurs when the sender sends
faster than the receiver can receive
• Simple solution is to acknowledge each packet
before sending the next (“stop and go”)
• However, this can be wasteful of bandwidth
Sliding window protocols
• Sender and receiver agree a window size
(number of packets)
• Initially a whole window is sent
• After that, each packet is acknowledged
and then another can be sent
Congestion
• Congestion arises due to too much traffic
and/or bottlenecks in the network
• Limited storage in switches means that
packets get dropped
Dealing with congestion
• Detecting congestion
– switches can inform senders
– packet loss can be used as a measure of
congestion
OSI Model in Details
This is the second part of this lecture
• The model
• Functions of the layers
7OSI
Application
Presentation
This is the second part of this lecture
[ 1] PHYSICAL LAYER
Session
Transport
Network
Data Link
Physical
Goals of Physical Layer
• Service: move information between two systems
connected by a physical link
• Interface: specifies how to send and receive bits
• Protocol: coding scheme used to represent a bit,
voltage levels, duration of a bit
• Examples: coaxial cable, optical fiber links;
transmitters, receivers
Goals of this lecture for Physical
• Explain how electric current can be used to
transmit bits over short distances
• Present a popular mechanism (RS-232) for
sending characters this way
• Introduce notions of baud rate and bandwidth
Asynchronous communication
• Where the receiver does not know when the
sender will transmit
– transmit when data is ready
– variable delays between transmissions
– no sender-receiver coordination beforehand
• E.g., keyboard connected to a computer
• Technically, the electrical signal does not
contain information about where individual
bits begin and end
Using electric current to send bits
• Use a wire to create a circuit between the sender
and receiver
• Negative voltage on the wire could represent a 1
and positive a 0
• Waveform diagram shows variable delay
The RS-232 standard
• To connect keyboards, terminals etc. to
computers over copper wire
• Is concerned with 7-bit characters
• Electrical details (voltages)
• Serial communication
• Asynchronous (for each character)
RS-232 continued
• Never leaves 0 volts on the wire - an idle line
is the same as a 1 bit
• Sender and receiver agree how long a bit lasts
- receiver uses a local timer
• A 0 start bit signifies the start of a character
and is followed by 7 data bits
• A minimum gap of 1 bit between characters (a
phantom stop bit of 1)
Example RS-232 waveform
Baud rate
• Transmission hardware is rated in baud - the
number of signals that are generated per
second
• The baud rate need not be the same as the bit
rate, it depends on how many levels of signal
are used
• With RS-232 they are the same
Agreeing the Baud rate
• Sender and receiver agree on length of time
each bit is held => maximum number of bits
per second (e.g., 300, 9600, 19200)
• RS-232 may often have a configurable baud
rate (manually or by software)
Framing errors
• Might occur if the sender and receiver are set
to different baud rates
• Receiver samples the signal several times for
each bit to check for differences (framing
errors)
• Used by the break key to send an abort signal
Full duplex communication
• Two wires required to carry information in
one direction (return is a ground)
• Full duplex is two way communication and
needs 3 wires - ground is shared
Hardware bandwidth
• Hardware cannot change signals instantly =>
maximum speed at which bits can be sent
• Bandwidth - maximum frequency of signal
that a transmission medium can carry
• Measured in cycles per sec = Hertz (Hz)
• Every system (electronic and biological) has a
limited bandwidth
Bitrate, Baudrate and Bandwidth
• Bitrate – how many bits per second are being
sent
• Baudrate – how many signals per second are
used to send those bits
• Bandwidth – the number of signals per second
that a medium can accommodate
Download