Between two computers, which are in some level of communication, exist one or more computer networks. A network can be described as a connector which transfers data between the given devices. Every computer network contains network nodes which have part in forwarding the data.
There are two basic ways of transferring data through the network:
- using communication tunnel
- using information packages
Communication tunnel transfer consists of 3 parts:
- Establishing connection – needed network resources are reserved
- Exchanging information – captured network resources are not available for other connections regardless to existing information exchange
- Terminating the connection – network resources are released
Advantage of using communication tunnel is continuous flow of data in time. Communication tunnel uses TCP protocol (Transmission Control Protocol).
If we are using information packages for data exchange then we are not using communication tunnel (network resources aren't captured before transporting data, they are captured during information exchange). We are getting effective usage of network resources but it is harder to keep time conditions during communication.
For example, TCP is used to send a web page, because it is important for each bit to be correct and in right place (we don't want no weird looking stuff on our website), whereas during the Skype call, it is acceptable to send the data using UDP as it is more important for packets to arrive fast than to be sure each one has arrived. I.e. it is about integrity vs speed.
Network Layers
Every data transfer between two computers passes through different network layers. When we are talking about network layers we have to diversify two basic models: OSI(Open System Interconnection) and TCP/IP Model.
OSI Model
TCP/IP Model
Every data transfer starts with application layer and ends with application layer of the other side. Application layer can be described as software which offers user possibility to interact with network. When we are transferring some kind of information between two computers which aren't physically connected, we will always be in some kind of interaction with network. Application layer offers us a graphical user interface to participate in network traffic.
The main difference between those two models is that in OSI Model we have two layers (Session Layer i Presentation Layer) whereas is TCP/IP model they are included in Application layer. Presentation Layer is in charge for formatting information in appropriate form for recipient. Presentation layer usage can be seen in an ordinary internet communication where browser needs to know how to encode the answer from server, before displaying the web page to user. As server answers to browser request, it also sends information about the type of resource in MIME (Multi-Purpose Internet Mail Extensions) part of answer's header. According to MIME type, browser knows which kind of resource is returned from server (text, picture, video, audio...).
Session Layer has the main role in controlling session between two computers which are in stateful communication process. Session can be viewed as a sequence of logical transactions between the client (browser) and the server (computer which data we want to fetch) in some limited period of time. Sessions can be described in a lot of ways but I chose to describe it on a social networks example.
Let's assume you login on your account on some social network. Surely you have noticed that you always see only messages, pictures, videos and notifications connected to your account. How come you don't the see messages of other users? Secret is in sessions. When you login, session between your browser and server is opened and server will always know (during session) which data can be shown. You can stop session in a lot of ways (logout from page, close your browser etc).
Transport layer and every other layer under it, add extra information in packet's header in order to deliver network packet to correct destination.
Two protocols are characteristic for Transport layer, are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol):
- TCP represents safer way of communication because packets have been transferred without content duplication and in the given order. For that possibility a lot of regulations (which slow down communication) are needed
- UDP is characterized as unsafe communication when it comes to duplication content and receiving it in sent order, but packages are transferred faster.
Transport layer adds source port, destination port (and other parameters depending on kind of protocol which is being used) to the header of original packet. On the Transport layer packets are called segments.
Extended data is dropped to the lower Network layer. Network layer adds source and destination IP address to the packet. Every computer which is connected to internet has an IP address. On Network layer packets are called IP-datagrams.
Then, extended data drops to the lower Data Link Layer. Data Link Layer adds source and destination MAC address to the packet. MAC address represents address of computer network card. On Data Link Layer packets are called frames. Frames are array of bits (1 and 0) and they are sent two another side of communication.
Basically, every layer needs some kind of information to know what is happening. As we go down the layers from app to physical layer, new bits are appended to the message. As we go up the layers on the other side, from the wire to the app, we lose the information until we finally end up with the original message sent from the source device.
Every layer has a few characteristic protocols (application layer – HTTP, DNS, transport layer – TCP, UDP, network layer – IP etc).
Network protocols in real life
Internet search is based on client-server model. In browser search box we are entering domain name. Every domain name represents a server. When we click the blue link in our browser, we are establishing connection with server. Server is listening to connect event (like the one when we click on blue link in our browser search).
Connection between client and server goes through the sockets. Every socket must contains source and destination port, source and destination IP address and type of transport layer protocol which is being used. Server is sending answers for request and browser displays that answers in appropriate form for user.
Let's go to lower abstraction level to see all used protocols during sending request for some WEB page.
Let assume we were open our browser and wrote some kind of string array (URI) in order to open Web page. That URI represents domain name of server whose data we want to acquire. Computers only know how to work with numbers therefore domain name must be converted to a valid IP address. To convert the domain name, browser uses DNS protocol.
After browser found out IP address, HTTP connection between client and server is established. HTTP is application protocol which defines service of transferring web content between the computers over the Internet. For transfering data, HTTP is using TCP protocol (on Transport layer). TCP connection is also establish between client and server. For TCP connection destination and source port, destination and source IP address and the type of transport protocol must be known.
After establishing connection, client sends request to server for specific resource. Server is processing request and sends back resource to client. There can be a lot of types of resource in server answer. Type of resource is determined by MIME type which is written in header of server answer. Received answer is usually HTML document (i.e. – web page).
The end
This was only a quick introductory overview of the topic.
Communication networks are a complex entity and diverse cannot be explained in such a simple manner.
If you are interested in detailed explanation or discussion, leave some kind of feedback.
Thank you for reading.
Ethernet protocol is on physical layer and on data link layer?
What type of ethernet protocol you mean?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
The MAC and LLC layers of IEEE 802 networks such as 802.3 Ethernet, 802.11 Wi-Fi, and 802.15.4 ZigBee, operate at the data link layer. But at the same time the Ethernet physical layer is the physical layer component of the Ethernet family of computer network standards.
That picture got you confused I guess. Thank you for pointing that out.
A careful reader. I appreciate that.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Being a telco worker this was a lovely refresher course. Thanks!
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
What about simple terminals? Can't they be used as an application later? In this case, there is no graphical user interface, isn't it?
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit