Network Programming software development architecture, OSI seven layer protocol

  • Architecture Software Developer
    C / S architecture (client / server), and B / S structure (broser / server);
    the B / S architecture is essentially C / S architecture

  • Server: 24-hour service;
    client: When did want to experience the service, it's no server connection response

  • ps:
    mobile terminal looks C / S architecture is fire, in fact bs has been rising;
    micro-channel and Alipay are doing one thing: a unified interface;
    after the end of the phone is certainly more fire bs
  • OSI seven-layer protocol (network transmission will list the number of objects to be)
    • Physical connection layer
      based on electrical signal transmission of binary data 0101
    • The data link layer
      1. The predetermined electric signal grouping
      2. a predetermined intervention of any Internet computer must have a network card, a network card above each engraved with a unique world number (mac address) of
      the above two co called Ethernet protocol

    • Application of Ethernet protocols: Ethernet LAN-based communication protocol, can not communicate across local area network
    • PS:
      . A MAC address: 12 hex; vendor number is the first six, the number six pipelined
      b.
      switch: local area network, computer communication through the switch
      c.
      The Internet is a plurality of local area networks, each other Links made
    • Network layer
      IP protocol: it specifies long as the computer connected to the Internet must have an IP address

    • ip address Features: decimal point
    • IP address range: 0.0.0.0-255.255.255.255

    • IP address There are two versions: ipv4, ipv6
      reason ipv4 ipv6 generated is not enough

    • IP addresses can be dynamically assigned
    • A transport layer
      communication between computers in fact communication between application programs on a computer

    • TCP / UDP protocols are based on port work
    • TCP protocol (streaming protocol, reliable protocol)
      TCP protocol-based communications, it must establish a two-way channel four three-way handshake waved;
      establishing a connection is three times, four times is disconnected
    • ps: the reason why a reliable data transmission protocol is TCP because two-way channel: Wrong
      because of feedback mechanisms in communication

    • Port (port)
      Port: used to uniquely identify a computer on an application
      port number ranges: 0 to 65535
      Note: 0 to 1024. These are the operating system default port number used
      Recommendation: Use the port after 8000
    • Common software port numbers: MySQL: 3306; Redis: 6379; Django: 8000; flask: 5000;
    • Port number is dynamically allocated, the same purpose is to enable an application to serve multiple users simultaneously

    • Similarities and differences between IP and port:
      IP Address: An identifier for a computer to access the Internet
      port Port: An identifier for an application on one computer
      IP + port: the unique identifier access to the Internet of an application on a computer
    • The application layer
      HTTP protocol and FTP protocols
    • PS: Four waving three-way handshake
      • Three-way handshake process
        object of the three-way handshake to establish a bidirectional channel

        first handshake: a client wants the server sends a connection request (syn = n)
        second handshake: server receives syn packet, sends an acknowledgment back to the client (ack = n + 1)
                         at the same time this connection should send a request to a request (syn = m) to the client
        third handshake: the client receives the server syn packet, the server returns a confirmation to the connection packets (ack = m + 1)
        duplex channels completed structures

      • Four waving process
        object of the fourth wave is to disconnect the bidirectional channel established

        first wave: the client sends a disconnect request (syn = n) to the server
        a second wave: After the server receives packet syn, returns an acknowledgment (ack = n + 1)
        third wave: ① the server and not in the second package and sends a confirmation request,
                          because the process is not completed but also to complete the business, for example, has not transmitted after data transmission by the client in stage time_wait
                         after task end ② unfinished server, sending it to the client request disconnection packet (syn = m)
        fourth wave: customer syn receiving the request packet, and returns an acknowledgment (ack = m + 1)
        to this disconnect complete

      • Three-way handshake and four waving difference
        four times more than once because, after a client is disconnected,
        the server can not be directly disconnected, need to wait for the latter part of the business (such as data transmission has not been completed) after treatment is completed before the client send disconnection request,
        and received confirmation of the client's disconnection, thus to complete disconnection
      • Icon

 

Guess you like

Origin www.cnblogs.com/buzaiyicheng/p/11311477.html