Layer 1, the Physical Layer defines the characteristics of the hardware necessary to carry the data transmission signal. Things such as voltage levels, and the number and locations of interface pins, are defined in this layer (RS232C, V.35, IEEE 802.3, ...). TCP/IP does not define physical standards, it makes use of existing standards. Describes the way data is actually transmitted on the network medium.
The Physical Layer communicates directly with the communication medium, and has two responsibilities: Sending bits and receiving bits. A binary digit, or bit, is the basic unit of information in data communication. A bit can have only two values, 0 or 1, represented by different states on the communication medium. Other communication layers are responsible for collecting these bits into groups that represent message data.
Bits are represented by changes in signals on the network medium. Some wire media represent 0s and 1s with different voltages, some use distinct audio tones, and yet others use more sophisticated methods, such as state transitions.
A wide variety of media are used for data communication, including electric cable, fibre optics, light waves, radio, and microwaves. The medium used can vary, a different medium simply necessitates a different set of physical layer protocols. Thus, the upper layers are completely independent from the particular process used to deliver bits through the network medium.
The physical layer describes the bit patters to be used, but does not define the medium, it describes how data are encoded into media signals and the characteristics of the media attachment interface.
Layer 2, the Data Link Layer is responsible for delivering the data without errors to the next layer. It formats the packets for transmitting after delivery. Defines the network-frames. This layer synchronises the transmission and is responsible for error-control on frame-level (a frame is a block of data within network-specific addressing information), also error-correction so that information can be transmitted from the physical layer. It formats the message into a data frame, and the CRC-verification (this checks on errors into the frame) is in this layer established. This layer carries the access-method's for Ethernet and Token Ring. This layer also provide the address information for the physical layer on top of the transmitted frame.
Data Frame Format:
As data is exchanged between computers, communication processes need to make decisions about the various aspects of the exchange process:
As the receiving computer listens to the wire to recover messages send to it, it requires a mechanism by which it can tell whether to treat signals it detects as data-carrying signals or to discard them as mere noise.
If it is determined by the detection mechanism that what is on the wire is indeed data-carrying signals, the second decision the receiving end must be able to make is whether the data was intended for itself, some other computer on the network, or a broadcast.
If the receiving end engages in the process of recovering data from the wire, it needs to be able to tell where the data train intended for the receiver ends. After this determination is made, the receiver should discard subsequent signals unless it can determine that they belong to a new, impeding transmission.
When data reception is complete, another concern arises, and that is of establishing that the recovered data withstood corruption from noise and electromagnetic interference. In the event of detecting corruption, the receiver must have the capability of dealing with the corruption.
As can be concluded from the points made earlier, in addition to user data, computers must be able to exchange additional information about the progress of the physical communication process. To accommodate these decision-making requirements, network designers decided to deliver data on the wire is well defined packages called data frames.
It is important to realise that the primary concern of the receive process is the reliable recovery of the information embedded in the information field, with no attention paid to the nature of the actual contents of that field. Instead, processing the data in the information field is delegated to another process as the receive process reverse to listening mode to take care of future transmissions.
The reliable delivery of data across the underlying physical network is handled by the Data Link Layer. TCP/IP rarely creates protocols in this layer. Most RFC's that relate to this layer talk about how IP can make use of existing data link protocols. Defines how these streams of bits are put together into manageable chunks of data.
Devices that can communicate on a network frequently are called nodes, station or device. The data link layer is responsible for providing node-to-node communication on a single, local network. To provide this service, the data link layer must perform two functions. It must provide an address mechanism that enable messages to be delivered to the correct nodes. Also, it must translate messages from upper layers into bits that the physical layer can transmit. When the data link layer receives a message to transmit, it formats the message into a data frame (packets). The sections of a frame are called fields.
Figure 31 shows an example of a data frame.
The fields in figure 31 are as follows:
Start Indicator : A specific bit pattern indicates the start of a data frame.
Source Address : The address of the sending node so that replies to messages can be addressed properly.
Destination Address : The address of the receiving node to identifies messages that it should receive.
Control : Additional control information.
Data : All data that were forwarded to the data link layer from upper protocol layers.
Error Control : Contains information that enables the receiving node to determinate whether an error occurred during transmission.
Frame delivery on a local network is extremely simple. A sending node simply transmits the frame. Each node on the network sees every frame, and examines the destination address. When the destination address of a frame matches the node's address, the data link layer at the node receives the frame and sends it up the protocol stack. Data units at the data link layer are most commonly called frames, although the term packet is used with some protocols.
Figure 32 shows how simple delivering of a frame on a local network can be.
In figure 32, the source node simply builds a frame that includes the recipients destination address. The senders responsibility ends when the addressed frame is placed on the network. On LANs, each node examines each frame that is sent on the network, looking for frames with a destination address that matches its own MAC address. Frames that matches are received. Frames the dont match are discarded by Ethernet networks or forwarded to the next node by Token Ring networks.
Frames and Network Interfaces:
The data link layer defines the format of data on the network. A series of bits with a definite beginning and, constitutes a network frame, commonly called a packet. A proper data link layer packet has checksum and network-specific addressing information in it so that each host on the network can recognise it as a valid or invalid frame and determine if the packet is addressed to it. The largest packet that can be sent through the data link layer defines the Maximum Transmission Unit (MTU), of the network. All hosts have at least one network interface, although any host connected to an Ethernet has at least two: The Ethernet interface and the loopback interface. The Ethernet interface handles the physical and logical connection to the outside world, while the loopback interface allows a host to send packets to itself. If a packet's destination is the local hosts, the data link layer chooses to send it via the loopback, rather than Ethernet, interface. The loopback device simply turns the packet around and enqueues it at the bottom of the protocol stack as if it were just received from the Ethernet.
Associated with the data link layer is it a method for addressing hosts on the network. Every machine on the Ethernet has a unique, 48-bit address called its Ethernet address or Media Access Control (MAC) address. Vendors making network ready equipment ensure that every machine in the world has unique MAC address. 24-bit prefixes for MAC addresses are assigned to hardware vendors, and each vendor is responsible for the uniqueness of the lower 24-bits. MAC addresses are usually represented as colon-separated pairs of hex digits. Note that MAC addresses identify a host, and a host with multiple network interfaces may (or should) use the same MAC address on each. Part of the data link layer's protocol-specific header are the packet's source and destination MAC address. Each protocol layer supports the notation of a broadcast, which is a packet or set of packets that must be sent to all hosts on the network. The broadcast MAC address is: ff:ff:ff:ff:ff:ff. All network interfaces recognise this wildcard MAC address as a broadcast address, and pass the packet up to a higher-level protocol handler.
Layer 3, the Network Layer transmit the data and decide which route the data must follow through the internetwork. The network layer receives data-packets from the upper layer from the transmitter, and transmit these by so many connections and subsystems as needed to reach it destination. Defines the network packets. Controls the routing and the switching from the data through the network. This layer controls the transmitting from packets between stations. On basics from certain information will this layer transmit the data sequential from one station to one other by the most economic route, and both logical as physical. This layer permits that data units can be transmit to other networks if the are using special equipment, called routers. Routers are defined in this layer.
The Network Layer manages connections across the network and isolates the upper layer protocols from the details of the underlying network. The Internet Protocol (IP), which isolates the upper layers from the underlying network and handles the addressing and delivery of data, is usually described as TCP/IP's Network layer.
The most known protocol in this layer is IP. The network-layer is the limit from the communication subnet: Above this layer increases the level off abstraction dramatically. For layer 3 and lower is there mostly an upper-limit for the size of these packets. In broadcast-networks is the routing very simply, so that the network-layer is thin or event existing. This is the reason why the transport layer-protocol TCP so many times is combined with IP, called TCP/IP.
Only the smallest networks consist of a single, local network. The majority of networks must be subdivided. A network that consists of several network segments is frequently called an internetwork, or an internet, not to be confused with the Internet. These subdivisions may be planned to reduce traffic on network segments or to isolate remote networks connected by slower communication media. When networks are subdivided, it can no longer be assumed that messages will be delivered on the local network. A mechanism must be put in place to route messages from one network to another.
Figure 33 shows the schematic of a single, local network.
Figure 34 shows the schematic of a bridged network.
Figure 35 shows the schematic of a subnetted network.
To deliver messages on an internetwork, each network must be uniquely identified by a network address. When it receives a message from the upper layers, the network layer adds a header to the message that includes the source and destination network address. This combination of data plus the network layer is called a packet. The network address information is used to deliver a message to the correct network. After the message arrives on the correct network, the data link layer can use the node address to deliver the message to a specific node.
Forwarding packets to the correct network is called routing, and the devices that route packets are called routers.
An internetwork has two types of nodes:
End nodes: Provides user services. End nodes do use a network layer to add network address information to packets, but they do not perform routing. End nodes are sometimes called end systems or hosts.
Routers: Incorporate special mechanisms that perform routing. Because routing is a complex task, routers usually are dedicated devices that do not provide services to end users. Routers are sometimes called intermediate systems or gateways.
The network layer operates independently of the physical medium, which is a concern of the physical layer. Since routers are network layers devices, they can be used to forward packets between physically different networks. For example, a router can join an Ethernet to a Token Ring network. Routers also are often used to connect a local area network, such as Ethernet, to a wide area network, such as the Internet.
Figure 36 shows a schematic of a router that join an Ethernet to a Token Ring network.
Layer 4, the Transport Layer guarantees that the receiver gets the data exactly as it was sent. In TCP/IP this function is performed by the Transmission Control Protocol (TCP), However, TCP/IP offers a second Transport Layer service, User Datagram Protocol (UDP) that does not perform the end-to-end reliability checks.
All network technologies set a maximum size for frames that can be sent on the network. Ethernet limits the size of the data field to 1500 bytes.
This limit is necessary for two reasons:
Small frames improve network efficiency when many devices must share the network. If devices could transmit frames of unlimited size, the might monopolise the network for an excessive period of time. With small frames, devices take turns at shorter intervals, and devices are more likely to have ready access to the network.
With small frames, less data must be retranslated to correct an error.
One responsibility of the transport layer is to divide messages into fragments that fit within the size limitations established by the network. At the receiving end, the transport layer reassembles the fragments to recover the original message.
When messages are divided into multiple fragments, the possibility that segments might not be received in the order sent increases. When the packets are received, the transport layer must reassemble the message fragments in the correct order. To enable packets to be reassembled in their original order, the transport layer includes a message sequence number in its header.
The transport layer is responsible for delivering messages from a specific process on one computer to the corresponding process on the destination computer. The transport layer assigns a Service Access Point (SAP) ID to each packet. The SAP ID is an address that identifies the process that originated the message. The SAP ID enables the transport layer of the receiving node to route the message to the appropriate process.
Identifying messages from several processes so that the message can be transmitted through the same network medium is called multiplexing. The procedure of recovering messages and directing them to the correct process is called demultiplexing. Multiplexing is a common occurrence on networks, which are designed to enable many dialogues to share the same network medium. Because multiple protocols may be supported for any given layer, multiplexing and demultiplexing can occur at many layers.
Although the data link and network layers can be assigned responsibility for detecting errors in transmitting data, that responsibility generally is dedicated to the transport layer.
Two general categories of error detection can be performed by the transport layer:
Reliable delivery: Does not mean that errors cannot occur, only that errors are detected if the do occur. Recovery from a detected error can take the form of simply notifying upper layer processes that the error occurred. Often, however, the transport layer can request the retransmission of a packet for which an error was detected.
Unreliable delivery: Does not mean that errors are likely to occur, but rather, indicates that the transport layer does not check for errors. Because error checking takes time and reduces network performance, unreliable delivery often is preferred when a network is known to be highly reliable, which is the case with majority of local area networks. Unreliable delivery generally is used when each packet contains a completes message, whereas reliable delivery is preferred when messages consist of large number of packets. Unreliable delivery is often called datagram delivery, and independent packets transmitted in this way frequently are called datagrams.
Assuming that reliable delivery is always preferable is a common mistake. Unreliable delivery actually is preferable in at least two cases: When the network is fairly reliable and performance must be optimised, and when entire messages are contained in individual packets and loss of a packet is not a critical problem.
Layer 5, the Session Layer manages the sessions (connection) between co-operating applications. In TCP/IP, this function largely occurs in the transport layer, and the term session is not used. For TCP/IP, the term socket and port are used to describe the path over which co-operating applications communicate. This layer is not identifiable as a separate layer in the TCP/IP protocol hierarchy.
The Session Layer is responsible for dialogue control between nodes. A dialogue is a formal conversation in which two nodes agree to exchange data.
Communication can take place in three dialogue modes:
Simplex: One node transmit exclusively, while another exclusively receives.
Half-duplex: Only one node may send at a given time, and nodes take turns transmitting.
Full-duplex: Nodes may transmit and receive simultaneously.
Sessions enable nodes to communicate in an organised manner.
Each session has three phases:
Connection establishment: The nodes establish contact. They negotiate the rules of communication, including the protocol to be used and communication parameters.
Data transfer: The nodes engage in a dialogue to exchange data.
Connection release: When the nodes no longer need to communicate, they engage in an orderly release of the session.
Connection establishment and Connection release represent extra overhead for the communication process. When devices are managed on a network, they send out periodic status reports that generally consist of single frame messages. If all such messages were sent as part of a formal session, the connection establishment and release phases would transfer far more data than the message itself. In such situation, communicating using a connection-less approach is common. The sending node simply transmits its data and assumes availability of the desired receiver. A connection-oriented session approach is desirable for complex communication. Consider transmitting a large amount of data to another node. Without formal controls, a single error anytime during the transfer would require resending of the entire file. After establishing a session, the sending and receiving nodes can agree on a checkpoint procedure. If an error occurs, the sending node must retransmit only the data sent since the previous checkpoint, The process of managing a complex activity is called activity management.
Layer 6, the Presentation Layer is for co-operating applications to exchange data, they must agree about how data is represented. This layer is handled within the applications in TCP/IP.
The Presentation Layer is responsible for presenting data to the application layer. In some cases, the presentation layer directly translates data from one format to another, whereas virtually all other computers use the ASCII encoding scheme. For example, if data is being transmitted from an EBCDIC computer to an ASCII computer, the presentation layer might be responsible for translating between the different character sets. Numeric data is also represented quite differently on different computer architecture and must be converted when transferred between different machines times.
A common technique used to improve data transfer is to convert all data to a standard format before transmitting data. This standard format probably is not the native data format of any computer. All computers can be configured to retrieve standard format data, however, and convert it into their native data forms.
Other functions that may correspond to the presentation layer are data encryption/decryption and compression/decompression.
Layer 7, the Application layer is the level of the protocol hierarchy where user-accessed network processes reside. An TCP/IP application is any network process that occurs above the transport layer. This include all the processes that the users directly interact with, as well as other processes at this level that users are not necessarily aware of.
The Application Layer provides the services user applications needed to communicate through the network.
Here are several examples of user application layer services:
Electronic mail transport.
Remote file access.
Remote job execution.