3. Introductory Networking
Third section in Complete Beginner learning path.
The OSI Model
The OSI model consists of seven layers:
Layer 7 - Application: provides networking options to programs that run on a computer. Works almost exclusively with applications, providing an interface for them to use transmit data, the application layer passes information down to the presentation layer.
Layer 6 - Presentation: receives data from the app layer, data is normally in a format the app understands but needs to be understood by receiving computer. This layer translates the data into a standard format and encrypts, compresses or handles other transformations before passing the data to the session layer.
Layer 5 - Session: looks to see if a connection can be made with the other computer upon receiving the data. If it cannot, it returns and error and the process stops. If it can then the session layer will maintain the connection and cooperate with the session layer of the remote computer to synchronise communication. Session layer sessions are unique to the communication in question, allowing multiple requests to be made to different endpoints simultaneously. Once a connection is successfully logged, the data is passed down to the transport layer,
Layer 4 - Transport: serves numerous functions. First, it decides which protocol to use, the two most common are TCP (Transmission Control Protocol) and UDP (User Datagram Protocol). TCP is a connection based protocol, meaning a connection is made and maintained for the duration of the request. This allows constant communication and ensures any lost data is resent. UDP does not resend lost data, normally used for video transmission where lost packets can't be resent. TCP is for accuracy over speed. Once protocol is selected, the transport layer divides the transmission into segments (TCP) or datagrams (UDP).
Layer 3 - Network: responsible for locating destination of request. Network layer takes the IP and identifies the best route to take. This works with logical addresses which are software controlled, these provide order to networks. The most common form of logical addressing is IPv4 or IPv6.
Layer 2 - Data Link: focuses on physical addressing. Packet from network layer include the IP address and this adds the MAC address of the receiving endpoint. Every network enabled computer contains an NIC (Network Interface Card) which comes with a unique MAC (Media Access Control) address. This address is set by the manufacturer and cannot be changed (but can be spoofed!). Data link is also responsible for formatting data suitable for transmission, additionally, this layer checks the info hasn't been corrupted during transmission.
Layer 1 - Physical: hardware of the computer, converts binary data to signals and transmits them across the network as well as converts signals received back to binary data.
Encapsulation
As data passes down the OSI model, more information is added to the start of the transmission. For example, the network layer would add source & destination headers and the transport layer would add information specific to protocol being used.
Data is given different names at different stages. In layers 7, 6 and 5 the data is referred to as data. In the transport layer the data is referred to as a segment (TCP) or a datagram (UDP). In the network layer, this is called a packet. In the data link layer it is a frame and finally the frame is broken down into bits.
When a message is received this process is reversed (de-encapsulation).
TCP/IP Model
Similar to the OSI model but only has four layers: Application, Transport, Internet and Network Interface.
This model takes its name from the two most important protocols in the process - Transmission Control Protocol & Internet Protocol.
TCP is a connection based protocol. To send data via TCP a three-way handshake must be performed. Your device must sent a request to a remote server with a SYN (synchronise) bit. The server must then respond with a packet containing the SYN bit and an ACK (acknowledgement) bit. Finally, your computer will return the ACK bit on its own, indicating the connection is successful and data can be transferred.
Last updated