New Post has been published on http://www.ismailkeles.info/revision-networks-layers-and-protocols.html
Revision: networks, layers and protocols
Networking Networking supports communication between two or more programs running on physically distant machines. For example all the following require network support: ⢠a WWW browser client using a WWW server, ⢠mail from a user agent program to a remote mail box, ⢠remote access to a data-base, ⢠a remote shared file server system, ⢠downloading an MP3 music file.
Protocols To request any service or exchange any information between 2 programs there must be an agreed set of commands and data formats, this is a protocol. So, for example, the commands and data sent between a World Wide Web browser and a remote server are a protocol. The browser (probably) uses the GET command follow by the name of the required file (page), this protocol is recognised and understood by the web server program which responds appropriately. Similarly the format of packets sent between Ethernet cards and their drivers are a protocol. The programs exchanging messages are called peers.
Networking layers Two very important concepts in understanding networking are protocols and service layers. Figure 1.1 is a simplified view of the layers of network service in TCP/IP.
Layers and protocols
        The functions of the layers Each layer in the simple model provides facilities and carries out certain tasks: Hardware Bits of wire that can carry bits?
Data-link This layer is responsible for delivering packets for the network layer to other physically connected machines. It is responsible for error checking and driving the devices. Ethernet is a data-link layer protocol, it can only send packets to machines that are physically attached to the same wire.
Network This âspansâ different physical networks, it is a protocol that makes minimal assumptions so it can work on any and all data-link networks. Its job is to get packets from a machine on one physical network to a machine on anotherâthe inter-network protocol IP. Its main job is finding and maintaining routes to the remote systems.
Transport This layer turns IP packets into a âstreamâ of characters between different processes on different machines. This layer provides a âreliableâ service, if any IP datagrams are lost this layer must recognize this and re-transmit them. The layer guarantees delivery of all the data (for TCP anyway) in the correct sequence by using sequence numbers. This layer provides an interface to the application and supports streams of data (TCP) or arbitrary length single messages (UDP) to selected services on selected systems. The interface it provides is called the socket interface.
Application These are either user programs or standard utilities like: ftp, telnet, WWW browsers, network file store, or mail programs, each provides its own application oriented protocol. All of them use the transport layer service.
Usually all the layers up to and including the transport layer are in the kernel of the operating system and the applications are programs. So the interface between is usually a set of system calls.
Why have layers? One reason for having separate layers is that it makes the system simpler to use by defining clear interfaces for application or protocol developers.
        Layers with alternative protocols
Another reason is that the separation simplifies the use of alternative layers and protocols so that if the network level determines that one site is connected via a leased line it can pass a message packet to the appropriate driver, whereas a message to a different site will be passed to a different data-link level protocol driver, this is shown in figure 1.2. It also works in reverse: network (IP) packets contain a field in their  header identifying whivh transport level protocol they use and this is used to determine which level to pass the packet up to (either TCP or UDP).
Relationship between protocols and layers If a browser communicates with a web server they exchange messages (using the HTTP protocol), the messages are simple character strings: ⢠In order for the browser to send the HTTP message it must request that the layer below it (the transport layer) opens a connection to the server on the remote machine. ⢠The transport layer has to communicate with its peer, (the transport layer software on the remote machine) to establish the connection to the web server. Peers at the transport layer use the TCP protocol. ⢠In order for the transport layer to send its TCP messages it breaks them into âpacketsâ and requests that the network layer below it sends these packets to the remote machine which will pass them up to the peer transport layer. ⢠The network layer uses the IPv4 (and soon IPv6) protocol. It also uses a routing protocol to work out which machine to send to in order to get the remote end. and it must ask the datalink layer . . .
This is very similar to using the Post Office to convey letters.
⢠You write to your friend, the letter is your message (what you say in the letter and how they respond is your âprotocolâ), you put it in an envelope, put the address on the front and pass it down to the next âlayerââthe postal service, ⢠The local postal service sorts the letters and puts them in bags for different destinations, these are labelled. The bags are then given to an airline or a railway that uses the labels to deliver them to the remote postal service, ⢠The remote postal service unpacks the bags and delivers the letters. Notice that it is necessary to have a âprotocolâ that is understood by the lower layer (TCP, or postal service bag labels) in order for messages from a higher level to be delivered. Notice also that the layer below knows nothing about the higher level protocol (whether it is HTTP, or the contents of your letter).
A PACKETâ S JOURNEY Figure 1.3 shows the path of a packet through the network software layers when a client application sends a message to its peer (the corresponding server) application. First the application calls on the transport layer on its machine to convey the message to the right program at the destination, the transport layer will use the network layer to send the packet to the correct host, the network layer, once it has found the next hop on the journey to the destination, will call the appropriate data link driver to send the packet.
Packet encapsulation
         When the packet arrives at the next machine the data-link layer passes the packet to the network layer, it examines the packetâs destination address, it finds the next hop and uses the appropriate data-link driver. This continues until the packet arrives at the destination, then the network layer software will examine the destination address and find that it is its own machine so, instead of forwarding it, it passes the packet up to the transport layer software. The transport layer looks at the transport message and determines which application to give the message to.
Message encapsulation As data are passed down from an application level through the transport level, the network layer to the data-link layer they are encapsulated, this is shown in figure 1.4. In order to transmit the characters the transport layer puts a header on to communicate with its peer module at the remote end. In this header will be the port number. The transport module passes the data plus header to the network module which puts on its header containing the remote system address. Finally when this is passed to the data-link code another header is added.
Packet encapsulation
         Using ethereal to examine packets There is a program called ethereal that can âcaptureâ (which means: âtake copies ofâ, not âremoveâ) all the raw data data-link packets from a network interface. Since all the higher level protocols are encapsulated in, and carried by, the datalink packet and ethereal can decode all the protocols, it is therefore possible to examine any or all the protocols.
The following pictures (figs 1.5 and 1.6) of ethereal have a lot of detail but most should be ignored, the only concept being examined is packet encapsulation: one message, wrapped inside another.
In figure 1.5 the top window shows a list of packets that were captured, one packet has been selected, it is circled. More details of the selected packet are displayed in the middle window, Remember that each âlayerâ of networking software has its own task and must communicate with the equivalent layer at the recipient, so it attaches its own header. The middle window shows a decoding of each layerâs header, each can be âopenedâ (using the arrowhead at the left) to get more details, here the application layer protocol, HTTP, has been opened.
In the bottom window there is a hexadecimal dump of the whole raw packet including all protocol headers and data. When one of the protocols is selected in the middle window the corresponding section of the hex dump is highlighted, in the first picture the HTTP protocol is selected so the final (most nested) part is highlighted. But in the second ethereal picture the IP protocol is selected in the middle window and so, in the bottom window, only 20 bytes (the IP packet header length) are highlighted.
The second picture in figure 1.6 shows the selection of the IP header in the middle window and the highlighting of a different section of the hexadecimal dump in the bottom window.
Ethereal windows
         Highlighting a different header
        The OSI and TCP/IP layers
There is another (less used) view of layers called the ISO Open Systems Interconnection:
OSI levels
     The TCP/IP can be seen as a simplification of the OSI levels:
⢠The service level, 7â5 merged as the process or application layer. They provide FTP, Telnet, NFS, X11 and other higher level protocols. ⢠The transport layer, (the OSI layer 4) the link between different processes on different systems, the bit provided by TCP. ⢠The network layer (OSI layer 3), that links systems across one or more networks, it provides internet working. The IP bit. ⢠The data-link layer, (OSI layers 2 & 1). It is a network, for example Ethernet with its hardware and low-level protocols for moving data between 2 directly connected systems.
Networks and internets Networks might be campus networks, company networks, national or local. But in TCP/IP terms a network is most easily though of as a collection of hosts joined directly together at the data-link level. So those systems directly connected to a common Ethernet constitute a network, or some PCs connected via a token ring are a network. Therefore the Hatfield campus has more than one network, even though it is sometimes referred to as one and treated as such for network administrative reasons. A group of interconnected networks is called an internet; the most famous and largest internet, that grew from ARPA-net, is called the Internet. The Hatfield internet is in turn connected to the UK Universities national network Janet and, in turn, to the Internet.
This post is university course notes. year 05-06â˛.











