python network (1)

The internet

1.C / S and B / S architecture

C: client (client)
B: the Browse browser
S: server end (server)

C / S architecture: the basis between the client and server communications

Examples: QQ, deft, vibrato, micro-channel
advantage: personalization, fast response
disadvantages: development costs, maintenance costs, space, fixed to the user

B / S architecture: based communication between the browser and the server

Google browser Firefox browser 360
Pros: development and maintenance of low cost, space is relatively low, the user is not fixed
Disadvantages: a single set, no personalization, response speed is relatively slow

Network Communication Theory

80 years, fixed telephone (assuming no promotion of Putonghua)
a bunch of physical connection medium connection between two telephone 1.
2. Dial the other phone lock position
because there was no unity in Mandarin, so you and Henan and Shaanxi friend friendly exchanges, you have to learn the local dialect
promotion of Putonghua, unified means of communication
3. unity of communication
Internet communication:
1. connect two computers to have a bunch of physical media connection
2. find other computer software position
3. follow the Internet protocol

osi seven agreements

Application layer

Own protocol defined
radio (LAN) + mac address (computer location) + ip (LAN location) + port (located on your computer's software)
has more than four parameters, you can determine the location of any computer software in the world
representation layer
session layer

Transport Layer

Port protocol to determine the location of the software in your computer

Network layer

ip protocol: determining the position of a local area network (subnet)
to find the location of a specific software on the layer of matter
ip protocol:
four decimal
range 0-255
Subnet Mask: Class C Subnet Mask: 255.255.255.0
+ ip address and subnet mask bit, and calculates whether within a unified local area network (subnet)

data link layer

The data link layer of the bit stream to group
the very beginning in the Internet business is the United States of several companies, each with various custom grouping criteria,
and later unified standard: a standard data packets
Ethernet protocol: the bit stream logical grouping
a set of data is called a 01010101, packet data
head | data
head is a fixed length: 18 bytes
source address: 6-byte
destination address: 6 bytes
of data types: 6 bytes
data is minimum 46 . bytes and the maximum 1500 bytes
a data: a minimum of 64 bytes, maximum 1518 bytes of
a data | a data ...
each computer has a network card, a unique address is recorded on the card
computer communication:
within the same local area network, send data via broadcast in the form of
a local area network of computers all have received the message, the message analysis, is not mine, not discarded
mac address learning function of the
five interfaces of a switch: five computers

Physical Layer

Fiber Twisted-pair cable physical connection medium like
a physical layer bit stream is transmitted: 0101010
data packets should be regular, the data link layer packet is a matter of

What is the premise of our message?

You must know the mac address, you can broadcast a message to the form
In fact, network communication, as long as know each other with their ip ip can

Class C subnet mask can carry up to a plurality of network addresses ip?

172.16.10.0 occupied
172.16.10.255 broadcast address is occupied
172.16.10.1 occupied
can use 253 computers
if you want to send data to another computer, you have to know each other ip address

ARP protocol: Get ip address from the other side to the other side of the mac address of

Source goal mac mac goal Ip Ip data source

Guess you like

Origin www.cnblogs.com/SkyRabbit/p/11345268.html