ISO's Open Internet model (OSI)
The OSI (open System Interconnection) Open Systems Interconnect model is a network tiering model defined by ISO (International Organization for Standardization), a total Seven layers .
1. Physical layers (physical layer) : The physical layer defines the specifications for all electronic and physical devices, providing a physical medium for the transfer of the upper layer, with bits (bit) in the data Transfer unit. The specifications belonging to the definition of this layer are Eia/tia RS-232, Eia/tia RS-449, v.35, RJ-45, etc., the actual use of equipment such as network cards belong to this layer.
2. Data Link Layer : The data is framed for the bit streams received by the physical layer. Provide reliable data transfer service for error-free data transmission. The units of data in the data link layer are frames (frame). The specifications that are defined in this layer are SDLC, HDLC, PPP, STP, Frame relay, etc., and the device in use, such as a switch switch, belongs to this layer.
3. Network layer: The network layer is responsible for routing, grouping and reorganizing data between each subnet. The unit of data transfer in this layer is a packet (packet). Specifications belonging to this layer are defined as IP, IPX, RIP, OSPF, ICMP, IGMP , and so on. Devices that are actually in use, such as routers, belong to this layer.
4. Transport Layer (Transport layers) : Provides a reliable data transfer service that detects packets dropped by the router and then generates a retransmission request that can reorder the packets received.
5. Session Layer : Manages the session process between hosts, including session creation, termination, and management during sessions.
6. Presentation layers (Presentation layer) : The presentation layer transforms the data transmitted over the network, which allows the information to be communicated between multiple hosts to understand each other, including data compression, encryption, and format conversion.
7. Application tier (application layer) : The application layer communicates with the application interface for the purpose of presenting to the user. In this common agreement are: HTTP,HTTPS,FTP,TELNET,SSH,SMTP,POP3 etc.
OSI and Mail sending
TCP/IP four layer model
The difference between the TCP/IP four layer model and the OSI seven layer model
TCP/IP main protocol
Two host computers running FTP
Network connected via router
Peer Communication
Package (encapsulation)
Split (demultiplexing: Unpacking)
Port
Known ports (well known Ports) : from 0 to 1023, these ports are assigned and controlled by the IANA tightly bound to some services. Usually the communication of these ports clearly indicates the protocol of a certain service. For example: 21 is the FTP service port.
Register port (registered Ports) : from 1024 to 49151. Some of its ports are not controlled by the IANA but are registered by the IANA and provide a list of usage. They are loosely tied to some services. This means that there are many services bound to these ports, which are also used for many other purposes. Example: 1433 Microsoft SQL Service Port
Dynamic or private port (Ports) : from 49152 to 65535. IANA regardless of these ports. In fact, machines typically allocate dynamic ports from 1024 onwards. But there are exceptions: Sun's RPC port starts at 32768
Socket Programming Practice (--ISO/OSI) and TCP/IP