OSI - dejanu/linux GitHub Wiki

Application(7):

HTTPS,FTP,DHCP,SMTP,DNS,SMTP,IMAP,POP

Presentation(6):

Formats / standardization of the data and hands it to layer 5. Encrypting and decryption of the data.
Data compression. MPEG,GIF,JPEG

Session(5)

Handles the exchange of information, restart sessions,

Transport(4):

SEGMENTATION is done here !
Creates a logical connection between sender and receiver.
SENDER info: source port, source IP, source MAC
RECEIVER info: receiver port, receiver IP, receiver MAC

Transfer types:

  • Reliable (sender confirmation): TCP (e.g. email-SMTP, webpage-HTTP)
  • Unreliable (best-effort): UDP (e.g video audio stream-VOIP, or DHCP)

VOD is based on TCP and not UDP, due to network bandwidth constrains;
TCP is stateful (keeps track of state) and is connection oriented (prior to forwarding traffic a connection/session is established using a 3-way handshake), has order delivery for segments, resend lost segments and has flow control which ensures that the receiver is able to process the data
UDP main feature is quick flow of data, pieces of communication in UDP are caller datagrams

Device: Router

Network(3):

IPV4, IPV6 (Connection-less, Best-effort aka unreliable doesn't recover , Media Independent)

  • Addressing end devices (end devices must be configured with unique IP)
  • ROUTING (choosing the output interface for an router or for more multiple routers choosing the optimal path from source to destination) - port forwarding, no of hops ?
  • Encapsulation / De-encpasulation
    Routing protocols:

Data Link(2) How to format the frame for use with different media:

MAC, Ethernet 802.2, ARP,HDLC
Device: WAP, Switch, modem DigitalSubscriberLine (signal conversion)
Sub-layers:

-LLC(Logica Link Control) aka SW side like NIC drivers
-MAC(Media Access Control) aka HW side
CAM table in which we have (MAC-PORT):
Source MAC in the Learning process, and uses Destination MAC for Forwarding and Flooding

Physical(1)

Physical addresses are encapsulated at the data link layer. Logical addresses, also known as IP addresses, are encapsulated at the network layer. Port addresses are encapsulated at the transport layer. No addresses are encapsulated at the physical layer. E.g of protocol Ethernet 802.3


TCP/IP:

Application

Transport

Internet

Network Access

Data encapsulation 2 steps :

  1. Application generates useful data (mail,files,webpage)
  2. The other layers (Transport, Internet, Network Access) add control information, which is needed only when transmitting data.

PDU (Protocol Data Unit) == Segment, Packet, Frame

l4 [mail data 1/5] = payload
l3: [transport header][mail data 1/5] = segment
l2: [network header][transport header][mail data 1/5] = packet
l1: [data link header][network header][transport header][mail data 1/5][data link trailer] = frame


EXPAND [data link header]:
[Frame Start][Destination MAC][Source MAC][Type][Control]
LLC-[Type] = indicated the layer 3 protocol LLC-[Control] = QOS (frame prioritization based on MAC)

EXPAND [data link trailer]:
[Error Detection][Frame Stop]
[Error Detection] = CRC
[Frame Stop]


EXPAND [network header]:
[Version] = 4 bytes for IP Version
[IHL header] = Internet header Length (min size of the Header) 20 bytes
[Type Of Service] = Differentiated Services Field allocate and prioritize service classes (QoS)
[Total Length] = Packet length
[Identification] = Packet ID used for fragmentation
[IP Flags] = 0 or 1 x - unused , D - Don't fragment (0 can fragment 1 cannot) , M - More fragments ( 0 last fragment, 1 more fragments)
[Fragment Offset] = Fragment ID from a certain packet ( x8)
[Time To Leave] = counting the no of hops (layer 3 equipment aka router) from source to destination (init values 63,128,255) when TTL==0 => the packet is discarded and ICMP time exceeded is sent to source IP
[Protocol] = type of layer 4 protocol
[Header Checksum] = data integrity in IP header
[Source IP] = packet filtering (Access Control List)
[Destination Ip] = routing criteria


EXPAND [transport header] used to identify and manage each segment:
TCP segments header 20 bytes:[Source Port] [Destination Port] [Sequence Number] [Ack Number] [Window Size] [Checksum]
UDP datagrams header 8 bytes: [Source Port] [Destination Port] [Length] [Checksum]

Layers purpose

DATA LINK

Specifying the encapsulation method used for specific types of media
Allowing the upper layers to access the media
Accepting Layer 3 packets and packaging them into frames
Preparing network data for the physical network
Controlling how data is placed and received on the media
Exchanging frames between nodes over a physical network media, such as UTP or fiber-optic
Receiving and directing packets to an upper layer protocol
Performing error detection

NETWORK
Addressing levels : network and host
The router forwards the packets based on network portion of IP address
Levels of hierarchy: network, sub-network , host
Provided services: routing packets; encapsulate packet from Transport Layer

Broadcast domain

Switches propagate broadcast out on all interfaces (except the one on which it was received)
Router DO NOT propagate broadcast, each router interface (GE 0/0,FE 0/0) is connected to a certain broadcast domain.

TRANSPORT
Segments data into blocks that can be reassembled in proper sequence at the destination device
The source and destination ports are placed withing the segment.
The segments are encapsulated within a IP packet which contains IP address of the source and destination.
SOCKET == IP:PORT, sockets enable multiple processes running on a client, to distinguish themselves from each other.
Multiplexing multiple communication streams for many applications on the same network
Managing the reliability requirements if any.
Provides services like: error recovery ; flow control and connection establishment