Computer Network Layers CIS748 Class Notes
Computer Network Layers CIS748 Class Notes
1 The Layers
Normally, the task of communication from computer to computer is broken up into layers.
Each device attached to the network has a corresponding ‘stack’ of these layers, where each
layer conceptually talks to the corresponding layer on the other computer. Each layer only
needs to know how to interface to the layers above and below it.
The ‘standard’ layered model used for illustrative purposes only is the OSI Model1 . It
consists of seven layers:
There is an interesting quote from UNIX System Administration Handbook: “Some think
a financial layer and a political layer should be added to these. There is no magic about
the number seven; seven committees were involved in the specification, and one layer was
created for each.”
In any case, there have been some attempts to implement the OSI model, and some sorta
actually worked, etc., but it never managed to catch on.
∗
[email protected]
1
http://en.wikipedia.org/wiki/OSI model
1
1.1 PDU, Protocol Data Unit 2 OSI MODEL
1.2 Encapsulation
Layers are arranged in a way that each layer only has to know about layers that are directly
below or directly above. All data from the higher layers is wrapped (and subsequently
unwrapped at the destination) so that, for example, the data-link layer doesn’t have to
know whether you’re browsing the web or transferring files—all it sees are just a bunch of
bits that need to be transferred.
1.3 Services
We can also view the layered model as higher layers getting services from lower layers and
lower layers providing a service to higher layers.
2 OSI Model
Even though the OSI Model isn’t the actual ‘real’ model, it is still useful for illustration
purposes as an idealized network model. It consists of seven layers (descriptions taken from
Wikipedia):
2
2.2 Presentation Layer 2 OSI MODEL
3
2.7 Physical Layer 4 IEEE STANDARDS
and Aloha for local area networks. This is the layer at which bridges and switches operate.
Connectivity is provided only among locally attached network nodes.
• participation in the process whereby the communication resources are effectively shared
among multiple users. For example, contention resolution and flow control.
3 TCP/IP
The TCP/IP can be thought of consisting of four layers:
The TCP/IP does most of the things the OSI model does, except it does it in four layers,
and is actually a lot more robust and real than the OSI idea.
TCP/IP is setup in such a way that it doesn’t really matter which network is used
underneath. The Link Layer can use physical wire, wireless, serial lines, etc.
4 IEEE Standards
In 1985 the Computer Society of the IEEE started a project called Project 802, to set
standards to enable intercommunications between equipment from variety of manufacturers.
It is a specification for the data-link and physical layer of major LAN protocols.
The 802 standard split the data-link layer into 2 layers:
4
5 COMPUTER NETWORKS INTRO (REVIEW; OTHER NOTES)
• Media Access Control (MAC): IEEE 802.3 (CSMA/CD), IEEE 802.4 (Token Bus),
IEEE 802.5 (Token Ring), IEEE 802.5 (DQDB—distributed-queue dual-bus network),
IEEE 802.11 (Wireless).
The physical layer is also split into a few layers, depending on the type of network we’re
dealing with. Generally, we’ll have two primary things: PMI (Physical Medium Independent
and PMD (Physical Medium Dependent). Those are generally broken up into PLS (Physical
Layer Signaling), AUI (Attachment Unit Interface), MAU (Medium Attachment Unit), MDI
(Medium Dependent Interface).
5
5.4 IP over Serial Lines
5 COMPUTER NETWORKS INTRO (REVIEW; OTHER NOTES)
getty on the serial port on one computer, and on another computer, you can cat the serial
port device to read/write it and actually be logged into the other computer through a serial
port (and obviously use all the command line programs).
UNIX has a bunch of virtual terminals, and when the system starts up, getty is executed
on a bunch of those terminals. That’s why you see a login prompt on the screen (your
screen/keyboard are just treated as command line terminals as far as the computer are
concerned).
There is a program called stty which you can use to adjust the properties of your
terminals. For example, to change the speed of a serial port, or to enable/disable control
flow options, specify special characters, number of rows/columns, etc.
5.4.1 SLIP
SLIP (Serial Line Internet Protocol) is probably the simplest one, and at one point, you’d
use it if you wanted to setup a dial-up connection to the Internet from your Linux box.
5.4.2 PPP
PPP (Point-to-Point Protocol) is a huge bloated standard that is capable of quite a bit more
than just sending packets. When you dial into the your ISP, this is what you’re using.
5.4.3 Others
There may be other such encapsulation protocols used—so you can’t just dial up and expect
things to work (via standard networking configuration). Some ISPs require you to have
special “dialer” software that enables your Windows box to use other encapsulation protocol.
AOL was notorious for that.
6
5.5 TCP/IP 5 COMPUTER NETWORKS INTRO (REVIEW; OTHER NOTES)
5.5 TCP/IP
TCP/IP is a whole bunch of various protocols stuck into one:
5.5.1 IP
Internet Protocol, or IP, is used to transport RAW data from one machine to the next. This
involves hopping from computer to computer until the data gets there.
5.5.2 ICMP
Internet Control Message Protocol, or ICMP, is used as a helper protocol for IP. It provides
assistance with error messages, routing, and echo requests.
5.5.3 ARP
Address Resolution Protocol, or ARP, provides services to resolve logical network addresses
to hardware network addresses. Generally, figuring out which IP addresses correspond to
which MAC addresses.
It basically screams out to the network “does anyone know the hardware address for this
IP”. Then some machine (if it is alive) will respond, “Yes, here I am.”
5.5.4 UDP
User Datagram Protocol, or UDP, sends a packet from one program to another program. It’s
unreliable, and connectionless.
5.5.5 TCP
Transmission Control Protocol, or TCP, sends a stream of data from one program to another
program. It is reliable, and connection oriented (establishes a ‘session’).
7
5.7 Internet Addresses
5 COMPUTER NETWORKS INTRO (REVIEW; OTHER NOTES)
So while we were just sending 100 bytes via UDP, over the Ethernet, that sent 146 bytes.
In any case, most networks that most people are concerned with are B and C.
5.8 Routing
Routing is the process of directing a packet through the network to the destination computer.
You can view it as asking for directions. You are sent to deliver something to an unknown
city. You ask for directions, and someone may point you towards a general direction (or
towards someone who may known the general direction). You soon get to the city, and
you start asking for more specific information concerning the street address, etc. Same idea
works for routing.
For routing to work, the operating system maintains a routing table. It is just a table
of network masks and destinations. Whenever the kernel sees a packet, it figures out which
network it corresponds to, and sends the packet to that network—that’s all there is to it.
There are also ‘default’ routes; when everything else fails (you don’t know what to do with
a packet) you send it off to the default route.
8
5.8 Routing 5 COMPUTER NETWORKS INTRO (REVIEW; OTHER NOTES)
There is static routing and dynamic routing. Static means that you setup the routing
table manually, at boot-time, etc., and it stays around. For small networks that is quite
efficient.
Dynamic routing involves the use of routing daemons like routed or gated to discover
the network topology and how to reach distant networks. There are many approaches to
this, which we won’t get to at this time.