Computer network diagnostics: basic protocols

Source: Internet
Author: User
Tags configuration settings

During the time when I started network debugging, I always wanted to figure out how LAN access to the Internet was. Now pay attention to your computer. After the boot, after dozens of seconds of waiting, the operating system interface on the screen will appear in front of us. Just click on the browser icon to access our favorite website. However, nothing appears on the webpage as you think. What's wrong? Don't worry. We will handle this problem as soon as possible. On any operating system, we can fix it with network diagnostic software.

But the first thing we need to know is how you access the network?

This problem seems trivial, but it usually takes a long time for no response. Whenever we ask the computer to use the network, we mean any adapter or cable, and sometimes a router is needed. Of course, these things are very important to the use of computer networks, but they do not allow user access. To effectively use computer networks, our service specifications must be installed in the network protocols of any computer.

Of course, there are some different solutions for different networks. The simplest one is the TCP/IP protocol that has been installed by default on our computer and has a permanently assigned IP address, which is an eternal brand in the local configuration settings. This is the simplest solution we can access, but it is not actually safe, so we assume that the Administrator has made some other settings.

Most likely, your DHCP server has been started by the Administrator. This service allows any workstation on the network to dynamically allocate IP addresses. There is usually a private IP address in the local network, which is not visible on the Internet. We can only see the vro network IP address. The real purpose of a translation task is to access the private address through appropriate responses and obtain the content on the screen. These are what we really need. Sometimes the Administrator has some reason to install an old internet protocol. In fact, the gateway is used to package data in the network. It is responsible for the translation of relevant network protocol data.

If we use a solution based on an internal network VPC address that will never be found on the Internet, this solution is called the network address translation technology, which is abbreviated as NAT. There are also multiple types of networks based on NAT technology. I divide NAT into static, dynamic, active, passive, positive, and negative. Maybe someone else is different from me, but you have to admit that NAT itself is fascinating. The NAT workflow is as follows: a packet is transmitted to an internal network interface, which contains the address of our workstation. It takes the address in our private address pool, then, the router is routed to an external interface, where the network interface address is located. The real answer is that it is always redirected to what you need.

Private addresses are much more common than public addresses. Then, we have to deal with a lot of private addresses and a public address. In addition, in order to clarify the Addressing response of the server and connect a set of suitable internal ports to external port addresses, We need to allocate each address. There is a protocol that can provide dynamic ports for us from the pool. This technology that changes the data port is called PAT.

You may have noticed that all addresses from the internal network cannot be real addresses, but it is a good way to keep the addresses in the private address pool. This has many benefits, which protects private networks. Fortunately, there are some wonderful Methods everywhere, whether it's Network Address Allocation, testing, or software development. Sometimes some network conversion operations may also occur on the third and fourth layers of the entire ISO/OSI model. The IP address of the data packet does not change, but it is still between the fourth layer protocols. This solution is called the circuit layer proxy.

If you look at most networks, you will find some similarities that are visible to the naked eye. Most of the time, administrators can use the same private IP network. To solve Network conflicts, all computer addresses are dynamically allocated. The Dynamic Address allocation process can be completed by multiple protocols, but the most important of them is the DHCP service. This provides unlimited potential for transmitting information to specific workstations. DHCP not only provides information about the IP address data of the workstation, but also contains information about the gateway address. It has a wide range of information, such as the data network and server content.

Now, the quick introduction to computer network principles is over. Now we know how to communicate with each other. We also learned what services should be provided on our computers for effective communication. Now let's proceed to the next step. In our example, how can we see that the network configuration is correct? In fact, graphics programs can be used, but now we can only use the ifconfig installed by the system. This program can display or set all information in our network. The following is an example. Enter the ifconfig command to show that my current workstation is not connected to the network:

Root [~] # Ifconfig

Eth0 Link encap: Ethernet HWaddr dc: 0e: a1: 4b: 5d: 94

Inet addr: 169.254.186.86 bcast: 169.254.255.255 Mask: 255.255.0.0

Up broadcast running multicast mtu: 1500 Metric: 1

RX packets: 0 errors: 0 dropped: 2775300121 overruns: 0 frame: 0

TX packets: 2790 errors: 0 dropped: 0 overruns: 0 carrier: 0

Collisions: 0 FIG: 1000

RX bytes: 0 (0.0 B) TX bytes: 625441 (610.7 KB)

Interrupt: 122 Base address: 0 ×6000

Lo Link encap: Local Loopback

Inet addr: 127.0.0.1 Mask: 255.0.0.0

Up loopback running mtu: 16436 Metric: 1

RX packets: 1003 errors: 0 dropped: 0 overruns: 0 frame: 0

TX packets: 1003 errors: 0 dropped: 0 overruns: 0 carrier: 0

Collisions: 0 txqueuelen: 0

RX bytes: 379547 (370.6 KiB) TX bytes: 379547 (370.6 KB)

Root [~] #

All program options in ifoconfig. I wrote the following:

Ifconfig [-a] [-v] [-s] [[]

[Add <address> [/<prefixlen>]

[Del <address> [/<prefixlen>]

[[-] Broadcast [<address>] [[-] pointopoint [address]

[Netmask <address>] [dstaddr <address>] [tunnel <address>]

[Outfill <nn>] [keepalive <nn>]

[H <HW> <address>] [metric <nn>] [mtu <nn>]

[[-] Trailers] [[-] arp] [[-] allmulti]

[Multicast] [[-] promisc]

[Mem_start <nn>] [io_addr <nn>] [irq <nn>] [media <type>]

[Txqueuelen <nn>]

[[-] Dynamic]

[Up | down]…

<HW> = Hardware Type.

List of possible hardware types:

Loop (Local Loopback) slip (Serial Line IP) cslip (VJ Serial Line IP)

Slip6 (6-bit Serial Line IP) cslip6 (VJ 6-bit Serial Line IP) adaptive Serial Line IP)

Strip (Metricom Starmode IP) ether (Ethernet) tr (16/4 Mbps Token Ring)

Tr (16/4 Mbps Token Ring (New) ax25 (AX.25 Amp R) netrom (ampr NET/ROM)

Tunnel (IPIP Tunnel) ppp (Point-to-Point Protocol) arcnet (ARCnet)

DLCI (Frame Relay DLCI) FRAD (Frame Relay Access Device) irda (IrLAP)

X25 (generic X.25)

= Address family. Default: inet

List of possible address families:

Unix (UNIX Domain) inet (DARPA Internet) inet6 (IPv6)

Ax25 (AX.25 Amp R) netrom (ampr NET/ROM) ipx (Novell IPX)

Ddp (Appletalk DDP) x25 (CCITT X.25)

However, if you want to know more about this program, just type "main ifoconfig" in the console.

Wireless configuration is used in the iwconfig command console. This command takes the following parameters:

Usage: iwconfig [interface]

Interface essid {NNN | any | on | off}

Interface mode {managed | ad-hoc | master | ...}

N. NNN interface freq [k | M | G]

Interface channel N

Interface bit {N [k | M | G] | auto | fixed}

Interface rate {N [k | M | G] | auto | fixed}

Enc {NNNN interface-NNNN | off}

Interface key {NNNN-NNNN | off}

Interface power {period N | timeout N | saving N | off}

NNN nickname interface

Interface nwid {NN | on | off}

Interface ap {N | off | auto}

Interface txpower {nmw | NDBM | off | auto}

Interface point N

Interface retry {limit N | lifetime N}

Interface rts {N | auto | fixed | off}

Interface frag {N | auto | fixed | off}

Interface modulation {11g | 11a | si-| OFDMg | ...}

Interface commit

On the console of your operating system, you can run the "man ifconfig" command to view more information.

Now let's consider another important issue. Because we do not know the logic and physical address of the other party, how can we get the server's request for sending configuration information? Therefore, our computer sends information to all computers on the network. This is the so-called broadcast. The message is placed in the broadcast frame.

In the DHCP specification, the message is called a DHCPDISCOVER packet. If a response is received, a message called DHCPOFFER is returned. This message is usually sent to a single receiver in Unicast frames.

Next, the customer must select its DHCP server. To do this, you need to wait a moment to familiarize yourself with all DHCP servers in the region. It then sends a DHCPREQUEST message that contains information about the selected DHCP server, but it is affiliated to the broadcast of the entire network server to notify all servers, including the selected and unselected servers. The selected server then sends a DHCPACK message. This information contains the content of the client you want to configure. Therefore, if we assume there is at least one DHCP server on the network, we will get at least four replies in the initial diagnosis network.

Summary

The first part of this article is just a brief introduction to utilities. Maybe the content in the article is not very high-end for users, but not everyone will be exposed to high-end network configuration and agreement terms. In this article, I want to list some basic information about computer networks that everyone should be familiar. After completing this series of articles, you will learn a lot about how computer networks work. Before that, I suggest you try the basic network configuration and NAT configuration. I also recommend that you take a look at TCP/IP and DNS protocol specifications.

What do you expect next? Of course, we will discuss the DNS server and ARP table issues. In addition, we will try to implement our own C program, which can translate IP addresses into an easy-to-understand address information, and vice versa. We also need to learn how to use the Administrator tool and the nestat program. We will also analyze some cases in the computer network and see how to use the network analysis tool and ping program. In addition, we will learn how to use traceroute to track router packets.

If you have mastered these tools in this series of articles, you can become a good administrator. However, you also need to browse some other articles and some good luck to grow into an excellent network operating system administrator on the road of continuous exploration.

Related Article

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.