2- network concepts

Network Host: HOST identifies a computer on the network

Local use: "localhost" "127.0.0.1"

Network uses: '0.0.0.0' 

Get Local IP: ifconfig

Get computer name:

In [1]: import socket

In [2]: socket.gethostname()
Out[2]: 'tedu'

Get address computer name:

the In [. 3]: socket.gethostbyname ( 'localhost')
Out [. 3]: '127.0.0.1'

IP addresses

Definition: determining the network location address of a host on a network.

IPv4: dotted decimal 192.168.1.2 0--255

IPv6: 128 Wei

ping ip: test and whether a network host connectivity.

 

Obtain information through the host network address

Name of the network server addresses: Domain Name

1. easy to remember

2. The name of the express certain meanings

 

The network port number:

Port is part of the network address with the network to distinguish between a network application on the host.

* An operating system different network applications monitor a different port number.

Range: 1--65536,1--255 some well-known general-purpose port.

       256--1023 system application port

     1024--65535 own port

     Recommended> 10000

 

Gets the network port:

In [7]: socket.getservbyname('http')
Out[7]: 80

Network byte order: the data in the network transmission format.

 

Guess you like

Origin www.cnblogs.com/Chamberlain/p/11628728.html