60-367: Computer Networks: Instructor: Randy Fortier
60-367: Computer Networks: Instructor: Randy Fortier
Networks
algorithms
Knowledge to assist in network building and
administration
From small LANs to large-scale WANs
node?
Latency becomes the dominant factor when sending
____
____
_010
1110
0___
____
__10
1110
00__
____
___0
1110
001_
____
____
1110
0010
____
____
_110
0010
1___
____
__10
0010
11__
____
___0
0010
111_
____
____
0010
1110
0010
1110
Internetworking: internets (WANs)
e.g. The Internet
Any connection between two or more
networks
e.g. An Ethernet network connected to another
Ethernet network by glass fibre cable and
ATM switches
An Internet
LAN A LAN B
Backbone A
LAN C LAN E
LAN D
Internets: Purpose
Larger scope
Access more shared files
Communicate with more people
Execute programs on more machines
Network Properties
Sender Receiver
Higher level
Lower level
Layer n Layer n
… …
Layer 2 Layer 2
Layer 1 Layer 1
Network
The OSI Reference Model
A layered service model developed by the
International Standardization Organization
(ISO)
Defines 7 conceptual layers
Each serves a very specific purpose
OSI: Open System Interconnection
Developed as a reference to be used for all
future protocols
The OSI Reference Model
The 7 layers are (highest to lowest level):
1. Application
2. Presentation
3. Session
4. Transport
5. Network
6. Data link
7. Physical
The OSI Reference Model
Physical Layer
Represents the actual network hardware
Deals with problems such as:
Sending signals across wires
e.g. Charging a wire with a specific voltage
Network Layer
Handles the connection between sender and receiver
Deals with problems such as:
Determining a path from the sender node to the
recipient node (i.e. routing)
Determining the correct recipient (i.e. addressing)
Network congestion
Fragmenting data into packets
Reassembly of packets
The OSI Reference Model
Transport Layer
Represents an end-to-end reliable
communication stream
Deals with problems such as:
Lost (unacknowledged) packets
Duplicate packets
Reordering packets
The OSI Reference Model
Session Layer
Represents a dialogue between sender and receiver
Somewhat irrelevant in today’s networks
Handles the establishment of an authenticated
connection to the receiver
Deals with problems such as:
Authentication of the sender node on the packet
assembler and disassembler (PAD)
This is a remote computer which provided the lower
Presentation Layer
Specifies data representations so that both sides can
determine how to read data
e.g. How many bytes to use for floating point values
(including compressed as well as uncompressed
values, encryption)
e.g. What is the order of the bytes?
Uses an ISO-defined standard for these
representations: Abstract Syntax Notation 1 (ASN.1)
The OSI Reference Model
Application Layer
Defines what data is stored in the message
(specific to each application)
e.g. An E-Mail application would store such
things as recipient, subject, and body text into
an E-Mail application-level message
e.g. A web server would put header
information (information about the server & the
document) as well as the document itself into
its application-level messages
OSI Reference Model: An Example
Application
E-Mail:
Presentation •Recipient
•Message:
Subject
Session •Recipient
Body – CHAR(9)
Frame:
Session
•SubjectMessage:
– CHAR (17)
•• Data Link Header
Transport •Session Header
Body – CHAR (243)
••Transport
NetworkFrame:
Network Header
Message:
Recipient
Network •••Subject
Transport Header
Network Header
Transport Header
•••Body
Session Header
Transport
Session Header
Header
••Recipient
Recipient
Session Header
Data link
••Subject
Subject
Recipient
••Body
Body
Subject
Physical
01001101111010010011001…
•Body Network
OSI Reference Model: Routing
Application Application
Presentation Presentation
Session Session
Transport Transport
Router
Network Network Network
wire
e.g. The transport layer ensures that message arrive
Higher layers can assume that messages will arrive,
1. Application
2. Transport
3. Internet
4. Network Interface
5. Hardware
The TCP/IP Service Model
Application Layer
Defines what data is stored in the message (specific
to each application)
e.g. An E-Mail application would store such things as
recipient, subject, and body text into an E-Mail
application-level message
e.g. A web server would put header information
(information about the server & the document) as well
as the document itself into its application-level
messages
Essentially, this layer is identical to the application
layer in the OSI reference model
The TCP/IP Service Model
Transport Layer
Handles end-to-end communication
Divides the data into manageable chunks of
information (packets)
Provides reliable communication
Ensures that all packets are received
Internet Layer
Handles communication between machines
The path of a message is determined (routing)
The destination of a message is determined
(addressing)
Implemented by the IP protocol
Internet protocol
The TCP/IP Service Model
Hardware Layer
Actually transmits signals onto the network
Deals with issues such as:
How to transmit signals (e.g. electrify the wire)
How to detect problems (e.g. collisions)
Represents the actual network hardware
Essentially this layer is identical to the physical layer
in the OSI model
TCP/IP Service Model: Example
Application
E-Mail:
•Data Bytes
Transport
Transport Packet:
•IP Datagrams:
TCP Header
Internet ••Data
IP Header
Bytes
•TCP Header
Network •Data Bytes
Network Frame:
Interface •IP Header
•TCP Header
Hardware •Data Bytes
01001101111010010011001… Network
TCP/IP Service Model: Routing
Application Application
Transport Transport
Router
Internet Internet Internet
application layer
TCP/IP has no session layer
Not significant: It does little in modern networks
application layer
The TCP/IP Protocol in Action
Consider the following simplified network
route
The source (S) and destination (D) are
separated by two routers (R1, R2)
S R1 R2 D
The TCP/IP Protocol in Action
Let’s consider a web browser, using HTTP
The web browser on S sends a packet to the web server
on D
The application layer (i.e. the browser) provides the
logical (IP) addresses for S (IPS) and D (IPD)
The application layer also provides the port numbers for
the source (PortS) and destination (PortD)
S R1 R2 D
HTTP Req
The TCP/IP Protocol in Action
The Transport layer (TCP) uses the port
numbers (e.g. 2765 and 80) to create a TCP
packet (sometimes called a segment):
S R1 R2 D
Source Port: 2765
Destination Port: 80
HTTP Req
The TCP/IP Protocol in Action
The Internet (i.e. IP) layer uses the IP
addresses specified by the application layer
to create an IP datagram
e.g. 137.207.140.71, 24.87.204.16
Next, a route is determined for the packet,
using S’s routing table
S only needs one router’s address (R1)
S R1 R2 D
Source IP: 137.207.140.71
Dest IP: 24.87.204.16
TCP Segment
HTTP Req
The TCP/IP Protocol in Action
The MAC addresses of S and R1 (MACS and
MACR1) are used to create a network frame
If the MAC address of R1 is not known, ARP
(address resolution protocol) is used
S R1 R2 D
Source MAC: MACS
Dest MAC: MACR1
IP Datagram
TCP Segment
HTTP Req
The TCP/IP Protocol in Action
Let’s simplify the picture (for clarity)
In subsequent steps the IP datagram and its
contents will not change very much
S R1 R2 D
Source MAC: MACS
Dest MAC: MACR1
IP Datagram
The TCP/IP Protocol in Action
The network frame is transmitted on the
network to R1
This is possible since S and R1 are both
members of the same network
S R1 R2 D
Source MAC: MACS
Dest MAC: MACR1
IP Datagram
The TCP/IP Protocol in Action
R1 will extract the IP datagram from the
payload of the network frame
R1 looks up the destination IP address (IPD) in
it’s routing table, to determine which router
should get the datagram next (R2)
S R1 R2 D
IP Datagram
The TCP/IP Protocol in Action
R1 uses its own MAC address (MACR1) and
R2’s MAC address (MACR2) to create another
network frame
S R1 R2 D
Source MAC: MACR1
Dest MAC: MACR2
IP Datagram
The TCP/IP Protocol in Action
The network frame is received by R2, and the
IP datagram is extracted from it’s payload
R2 uses its routing table to lookup IPD
In this case, R2 is directly connected to D
This is called direct routing
S R1 R2 D
Source MAC: MACR1
Dest MAC: MACR2
IP Datagram
The TCP/IP Protocol in Action
Most likely, R2 does not have the MAC
address of D (MACD)
The address resolution protocol (ARP) is used
to determine the MAC address:
S R1 R2 ARP Request
D
IP: 24.87.204.16
IP Datagram
MAC: ?
The TCP/IP Protocol in Action
D recognizes it’s IP address and responds
with its MAC address (MACD)
e.g. 08-7F-3C-90-0C-DF
S R1 R2 ARP Response
D
IP: 24.87.204.16
IP Datagram
MAC: 08-7F-3C-90-0C-DF
The TCP/IP Protocol in Action
A network frame is created by R2 now that
the MAC address is known
The frame is sent directly to D
S R1 R2 D
Source MAC: MACR2
Dest MAC: MACD
IP Datagram
The TCP/IP Protocol in Action
D extracts the IP datagram from the network
frame (which is discarded)
The IP datagram’s payload is passed to the
transport layer
S R1 R2 D
Source MAC: MACR2
Dest MAC: MACD
IP Datagram
The TCP/IP Protocol in Action
The Transport layer (within D’s operating
system), will use the port numbers specified
in the TCP segment to determine to which
application it should send the segment
In this case, to the application bound to port
80 (the web server)
S R1 R2 D
Source Port: 2765
Destination Port: 80
HTTP Req
The TCP/IP Protocol in Action
Now, the web server on D has the HTTP
request, and it processes it
An HTTP response is sent back using the
same process
The web server uses the same IP addresses
and logical addresses as the last message
S R1 R2 D
HTTP Req
The Protocol Stack
We’ve just seen a simplified overview of how
the TCP/IP protocol stack works in practice
Subsequent lectures will break down many of
these steps, and discuss the process further
More details, and some additional steps will be
introduced as the course progresses
The lectures will be ‘bottom-up’, meaning we
will start at the lowest layer, and work our way
up