TCP/IP basics of Linux network programming (i)

Source: Internet
Author: User

From today onwards, will be exposed to network programming, the platform is Linux, the implementation of the language C language, and finally will implement a simple miniftp server.

The main content of the program is: Linux network programming TCP/IP foundation, socket programming, inter-process communication, threading, and practical FTP.

1.Iso/osi Reference Model : The Open System Interconnection interconnect model is provided by the OSI (International Organization for Standardization ) The International Organization for Standardization defines
Network layered model, a total of seven layers.

The specific meanings of each layer:
Physical layer (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 B in the data transfer unit. The specifications belonging to the definition of this layer have 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.
Data Link layer: encapsulates the bit stream data received by the physical layer into frames. To provide reliable data transmission services, to achieve error-prone data transmission, in the data link layer in the unit frame frames, belonging to the definition of this layer has SDLC,HDLC,PPP,STP, frame relay, etc., the actual use of devices such as switch switch belongs to this layer.
Network layer: The network layer is responsible for routing the data between the various subnets, grouping and rebuilding, the data transmission unit in this layer is the packet (package), the specifications defined in this layer are IP,IPX,RIP,OSPF,ICMP,IGMP, The devices used in practice, such as routers, belong to this layer.
Transport Layer (Transport layer): 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 by the order.
Session Layer: Manages the session process between hosts, including session creation, termination, and management during sessions.
The presentation layer (Presentation layer): The presentation layer exchanges the data transmitted over the network, allowing the information transmitted between multiple hosts to understand each other, including data compression, encryption, format conversion, etc.
Application layer: The application layer communicates with the application interface to achieve the purpose that is presented to the user, where common agreements are: HTTP,HTTPS,FTP,TELNET,SSH,SMTP,POP3

2.OSI and e-mail (the process of e-mail simulation of the OSI Protocol)

3.TCP/IP four-tier model

  

4.TCP/IP important protocols in the four-tier model

  

5.TCP/IP example of a four-layer model

6. Peer Communication

Peer communication: The same layer, such as the transport layer and the transport layer of communication seems to be direct communication, that is, the peer communication, in fact, based on the other layer of communication collaboration.

In fact, TCP/IP can be regarded as a protocol stack, the data from a end through FTP,TCP,IP, Ethernet driver gradually packaged, and then to the B-end of the Ethernet driver, through the ip,tcp,ftp and gradually unpack.

7. Encapsulation

   

  Summarize:

This article focuses on the Iso/osi reference Model, the TCP/IP four layer model, and some basic concepts (peer-to-peer communication, encapsulation, separation, port)

TCP/IP basics of Linux network programming (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.