CCNA Study Notes – Chapter 2
The OSI Reference Model separates the network communications process into seven simple layers. It thus:
- Defines the process for connecting two layers together, promoting interoperability between vendors.
- Separates a complex function into simpler components.
- Allows vendors to compartmentalize their design efforts to fit a modular design, which eases implementations and simplifies troubleshooting.
- Provides a teaching tool to help network administrators understand the communications process used between networking components.
The seven layers are: application, presentation, session, transport, network , data link, physical.
The transport, network, data link, and physical layers are responsible for moving data and information back and forth between these higher layers.
Layer 7 – Application Layer
The application layer provides the interface that a person uses to interact with applications, or in this instance, a particular application. The interface can be graphical or command line based. For example, the Cisco Internetwork Operating System(IOS) use a CLI, however Security Device Manager(SDM) uses a GUI.
There are many examples of application layer programs. The most common are telnet and Secure Shell(SSH), FTP, Web Browsers and Email.
The application layer provides a means for the applications to realise that a network is there and to take advantage of it. In other words, the application layer encompasses the protocols and services that the applications will employ to access network resources.
Layer 6 – Presentation Layer
The presentation layer is responsible for defining how information is transmitted and presented to the user in the interface that he or she is using. For example, text is represented in primarily two different forms: ASCII and EBCDIC.
The presentation layer can also provide encryption to secure data from the application layer; however, this is not common with today’s methods of security, since this type of encryption is performed in software and requires a lot of CPU cycles to perform.
The presentation layer determines how data is transmitted and represented to the user. Examples of presentation layer protocols and standards include ASCII, BMP, GIF, JPEG, WAV, AVI, and MPEG.
Layer 5 – Session Layer
The session layer is responsible for initiating the setup and teardown of connections . The session layer must determine whether data stays local to a computer or must be obtained or sent to a remote networking component.
The session layer is also responsible for differentiating among multiple network connections, ensuring that data is sent across the correct connection as well as taking data from a connection and forwarding it to the correct local application.
To setup connections or tear down connections, the session layer communicates with the transport layer. Remote Procedure Calls(RPC’s) are an example of a TCP/IP session protocol; the Network File System(NFS), which uses RPC’s, is another example of a protocol at this layer. The session layer is also responsible for error reporting of any issues at the application, presentation, and session layers and for implementing any type of class of service(CoS).
The session layer is responsible for setting up, maintaining, and tearing down network connections, Examples include RPCs and NFS.
Layer 4 – Transport Layer
The transport layer is responsible for the actual mechanics of setting up, maintaining, and tearing down a connection, where it can provide both reliable and unreliable delivery of data. With reliable connections, the transport layer is responsible for error detection and correction: when an error is detected, the transport layer will resend the data, thus providing the correction.
The session layer deals with timeout issues, notifications, hello packets to determine connection issues, and so on; the transport layer entails the actual delivery mechanisms of moving information(at the transport layer) between network components.
The transport layer has five main functions:
- It sets up, maintains and tears down a session connection between two components.
- It can provide for the reliable or unreliable delivery of data across this connection.
- It segments data into smaller, more manageable sizes.
- It multiplexes connections, allowing multiple applications to send and receive data simultaneously on the same networking device.
- It can implement flow control through ready/not ready signals or windowing to ensure one component doesn’t overflow another one with too much data on a connection. Both of these methods typically use buffering and are used to avoid congestion.
Therefore the five main purposes of the transport layer are: connection management, reliable and unreliable delivery of data, flow control, multiplexing, and segmentation.
When implementing a reliable connection, sequence numbers and acknowledgements(ACKs) re commonly used.
Some reliable connection protocols might also go through a handshake process when initially building a connection. This handshake process determines whether the two networking devices can build the connection and negotiate the parameters that should be used to provide a reliable connection. With TCP this is call the three-way-handshake.
In TCP/IP, a domain name service(DNS) query is a good example of when using a connection orientated protocol doesn’t make sense.
The information transferred between networking devices at the transport layer is called a segment. Segmentation is necessary to break up large amounts of data into more manageable sizes that the network can accommodate.
Connection multiplexing is needed to differentiate between data traversing the various connections.
TCP/IP uses a 16-bit field for the port number.
The transport layer can use two basic flow control methods:
- Ready/Not Ready Signals
- Windowing
With R/NR when the destination receives more traffic than it can handle, it can send a not ready signal to the source indicating that the source should stop transmitting data. Once the destination catches up, the destination sens back to the source with a ready signal. Once the ready signal is received, the source will start sending data again.
Two problems are associated with R/NR. Firstly, the destination may send the not ready signal to the source when it’s buffer has filled up, however whilst this message is on its way to the source, the source is still sending data to the destination, and the destination will probably have to drop the packets because its buffer is full.
The second problem with R/NR is that once the destination is ready to receive more data, it needs to send a ready signal to the source, which must receive it before more information can be sent. This can cause delays. Because of the aforementioned inefficiencies, R/NR is not commonly used.
Windowing is much more common than R/NR.
In windowing, a window size is defined that specifies how much data(commonly called segments at the transport layer) can be sent before the source has to wait for an acknowledgement(ACK). Once the ACK is received, source can send the next batch.
Windowing accomplishes two things: Firstly, flow control is enforced based on the window size. In most cases the window size is dynamically negotiated up front and constantly renegotiated during the lifetime of the connection. Secondly, throughout the windowing process, the destination tells the source what was received, and this can be good error correction.
Most connection –oriented transport protocols, such as TCP use windowing to implement flow control.
The larger the window size, the more efficient the transfer of information becomes.
What can make this more complicated however is that the window sizes on the source and destination devices can be different.
Layer 3 – Network Layer
The network layer provides quite a few functions. First, it provides for a logical topology of your network using logical, or layer 3, addresses. These addresses have two components: a network and a host component.
Layer 3 addresses allow devices that are on the same or different layer 2 medium or protocol to communicate with each other.
The network layer is responsible for three main functions:
- Defines logical addresses used at layer 3.
- Finds path, based on the network numbers of logical addresses, to reach destination components.
- Connects different data link layer types together, such as Ethernet, Fiber Distributed Data Interface(FDDI), Serial, and Token Ring.
The network layer provides a logical topology, defines layer 3 addresses, and finds best paths to logical address destinations. Routers function at the network layer and are responsible for packet switching and selecting paths for destinations. Layer 3 protocols include TCP/IP, IPX, and AppleTalk.
Each Layer 3 protocol has its own method of logical addressing. Correct assignment of each of these addresses on devices across your network allows you to build a hierarchical design that can scale to very large sizes.
All layer 3 addressing schemes have two components: network and host(or node). Each segment whether it be physical or logical in a network needs a unique network number.
MAC addresses however, do not need to be unique between two different broadcast domains.
TCP/IP IPv4 addresses are 32-bits in length. To make these more readable, they are broken into 4 bytes(octets) separated by a period. This is called dotted decimal notation.
A subnet mask determines the boundary between the network and host components of an address.
IPX Addresses are 80-bits in length, the first 32 bits are always the network number, and the last 48 bits are always the host address. IPX addresses are represented in hexadecimal.
Routers are devices which function at the network layer; they use logical network numbers to make forwarding decisions – how to get packets to their destinations. Routers build routing tables which contain routing information.
A router can use metrics to make routing decisions(where to send the packet for further forwarding). Many different types of metrics are used, such as bandwidth, delay, and hop count(etc).
Routing Information Protocol(RIP) uses hop count as a metric for making decisions, whilst EIGRP uses bandwidth, delay, reliability, load, and frame size(Maximum Transmission Unit or MTU).
Advantages of routers over data link layer devices such as switches and bridges:
- Logical addressing at layer 3 allows you to build hierarchical networks that scale to very large sizes.
- Routers contain broadcasts and multicasts. When a broadcast or multicast is received on an interface, it is not forwarded to another interface, by default. Routers can be used to solve broadcast problems(Routers create separate bandwidth and collision domains, but bridges and switches provide a cheaper solution)
- Routers are better at connecting different layer 2 technologies together, such as Ethernet and Token Ring or FDDI and Serial, without any conversion issues.
- Routers can switch packets on the same interface using VLANs.
- Routers have advanced features that allow you to implement quality of service using queing or traffic shaping, filtering traffic using access control lists(ACLs), or protecting traffic using encryption.
Layer 2 devices such as bridges and switches do not support hierarchical addressing – layer 2 MAC addresses support a flat addressing space. Another issue with layer 2 devices is that they don’t operate very well when connecting differing layer 2 technologies or protocols – Ethernet and Token Ring for instance. At layer 2 this process is called translation bridging. Layer 2 devices have issues translating between technologies/protocols for many reasons.
Ethernet supports frame sizes up to 1500 bytes, whilst Token Ring supports frame sizes up to 16KB.
Each interface of a router is a separate broadcast and collision domain.
Common tools to troubleshoot layer 3 problems include ping, traceroute, and Address Resolution Protocol(ARP).
Layer 2 – Data Link Layer
The data link layer provides for physical, that is hardware, addresses. Hardware addresses are commonly called Media Access Control(MAC) addresses.
The data link layer also defines how a networking component accesses the media to which it is connected and defines the medias frame type and transmission method.
To traverse layer 2 protocols, Ethernet to Token Ring for instance, a router is typically used.
Data Link layer is also responsible for taking bits from the physical layer and reassembling them into the original data link layer frame. The data link layer also does error correction in that it discards bad frames.
Data Link protocols and standards for LANs:
- Institute of Electrical and Electronic Engineers(IEEE) 802.2, 802.3, and 802.5
- Ethernet II
- ANSI’s FDDI
Data Link protocols and standards for WANs:
- Asynchronous Transfer Mode(ATM)
- Frame Relay
- High-Level Data Link Control(HDLC)
- Point-to-Point Protocol
- Synchronous Data Link Control(SDLC)
- Serial Line Internet Protocol(SLIP)
The data link layer defines hardware(MAC) addresses as well as the communication process that occurs within a media type. Switches and Bridges function at the data link layer. Error detection occurs here, but not correction(no retransmission, only dropping bad frames).
The data link layer is responsible for the following:
- Defining the MAC or hardware address.
- Defining the physical or hardware topology for connections.
- Defining how the network layer protocol is encapsulated in the data link layer frame.
- Providing both connectionless and connection oriented services.
In environments that use Systems Network Architecture(SNA) as a Data Link layer protocol, SNA can provide sequencing and flow control to ensure the delivery of data link frames. SNA was developed by IBM to help devices communicate in LANs(predominantly Token Ring).
Each machine on the same network or topology needs a unique MAC address. For instance , Frame Relay uses Data Link Connection Identifiers(DLCI).
The first six digits of a MAC are associated with the vendor, or maker(Organizationally Unique Identifier).
A logical segment can be a VLAN and can be referred to as a broadcast domain. It is important that within a logical or physical segment, all devices have a unique MAC. You can have the same MAC address in different broadcast domains without issues.
| Address Type |
Description |
| Unicast |
Represents a single device on a segment |
| Broadcast |
Represents every device on a segment |
| Multicast |
Represents a group of devices on a segment |
Each data link layer frame contains two MAC addresses: a source MAC address of the machine creating the frame and a destination MAC address for the device. A source MAC address is a example of a Unicast Address – only one device can create the frame.
A frame with a destination unicast MAC address is intended for only one network component on a segment. The membership of a multicast address is dynamic, and a multicast address represents a group of devices on a segment. A broadcast is a data link layer frame that is intended for every device on the network. For MAC broadcasts, all of the bit positions in the address are enabled, so it is FF:FF:FF:FF:FF:FF
Broadcasts are more effective than Unicasts when you want to send data to every device and broadcasts can be used to discover the unicast address of a device. In TCP/IP the Address Resolution Protocol uses this process to discover another devices MAC address.
Layer 1 – Physical Layer
The physical layer is responsible for the physical mechanics of a network connection, including:
- The type of interface used on the networking device
- The type of cable used for connecting devices
- The connectors used on each end of the cable
- The pin patterns used for each of the connections on the cable
- The encoding of a message on a signal by converting binary digits to a physical representation based on the media type, such as electrical for copper, light for fiber or a radio wave for wireless.
The physical layer is also responsible for how binary data is converted into a physical signal and vice versa.
Data Communication Equipment(DCE) terminates a physical WAN connection and provides clocking and synchronisation of a connection between two locations and connects to Data Termination Equipment(DTE). The DCE category includes equipment such as CSU/DSUs, NT1 and modems. A DTE is an end user device such as a router or PC that connects to the WAN via a DCE. In some cases the function of the DCE may be built into the DTE.
Normally the terms DCE and DTE are used to describe components.
Hubs and Repeaters operate at Layer 1.
Examples of physical layer standards include the following cable types:
- Category 3, 5 and 5E
- EIA/TIA 232, 449 and 530
- Multimode and Singlemode Fiber(MMF and SMF)
Encapsulation and De-Encapsulation
As data is passed from higher to lower layers, each layer adds information to the original data – typically a header and possibly a trailer. This is called encapsulation.
The data link layer adds both, where the term encapsulation is the most appropriate; however, upper layer protocols add a header, and a few protocols add a trailer. Both processes are referred to as encapsulating upper layer information and data.
The term Protocol Data Unit(PDU) is used to describe data and its overhead.
For TCP and UDP in the TCP/IP protocol stack, the transport layer adds a header but no trailer.
Once the physical layer is reached, the bits of the data link layer frame are converted into a physical layer signal – a voltage or light source or radio wave, or other source according to the physical medium which is in use.
When the destination receives the information, it goes through a reverse process of de-encapsulating information – basically stripping off the headers and trailers of the PDU.
The transport layer passes the segment down to the network layer, which encapsulates the segment into a packet. The packet adds only a header, which contains layer 3 logical addressing information(source and destination address). In the TCP/IP protocol stack, the terms packet and datagram are used interchangeably to describe a PDU.
Many protocols are within the TCP protocol stack – ARP, TCP, UDP, ICMP, OSPF, EIGRP, BGP, etc.
The data link layer encapsulates the packet into a frame by adding both a header and footer.
The important components placed in the Ethernet frame header are the source and destination MAC addresses, as well as a Field Checksum Sequence(FCS) value so that the destination can verify the validity of the frame.
The physical layer converts the bits into a physical property based on the cable or connection type.