A story so that you understand the concept of common network gateway, DNS, routing, ARP, etc.

Reprinted
gateway is a computer system or a device for converting the task of acting as. Between the use of different communication protocols, data formats, or language, or even completely different architecture systems, a gateway translator. And bridges simply convey different information, the gateway to the information received repackaged to meet the needs of the destination system. Meanwhile, the gateway can also provide filtering and security features. Most gateway runs on top of OSI 7 layer protocol - the application layer.

    As we all know, went from one room to another, is bound to go through a door. Similarly, sent from one network to another network information, it must go through a "gateway", which is the gateway Road crossing. As the name implies, Gateway (Gateway) is a network connection to another network's "gateway." According to different classification criteria, there are many gateways. TCP / IP protocol in the Gateway is the most common, and here we are talking about a "gateway" refer to a gateway in the TCP / IP protocol.

    So what in the end the gateway is it? Gateway is essentially a network IP address leading to other networks. For example, there network A and network B, IP address range of the network A is "192.168.1.1 ~ 192 168.1.254.", Subnet mask 255.255.255.0; IP address range of the network B is "192.168.2.1 ~ 192.168. 2.254 ", a subnet mask of 255.255.255.0. In the absence of routers, between the two networks can not be TCP / IP communication, even if the two network connections on the same switch (or hub), TCP / IP protocol will be based on the subnet mask (255.255 .255.0) determined that the two hosts on the network in a different network. And to enable communication between the two networks, it must be through the gateway. If network A host that the destination host the packet is not in the local network, put forward the packet to its own gateway, then the gateway to the network by the gateway forwards B, B of the network gateway forwarded to a network B host (such as shown in the drawings). Network B to the packet forwarding network A. So, just set the gateway IP address, TCP / IP protocol to communicate with each other between different networks. Then the IP address is the IP address which machine it? IP address of the gateway is the IP address of the device has a routing function, the device has a routing function routers, servers, routing protocol enabled (essentially serves as a router), the proxy server (also serves as a router).
    PS:

    A plurality of physical devices connected to the TCP / IP network, can be routed or delivered in IP packets between these networks. Gateway translates between different transport protocols or data formats (e.g., IPX and IP), generally because of its ability to convert and add it to the network.

     In the context of interactive and Novell NetWare network operations, it acts as a bridge between the server message block (SMB) used in Windows gateway network NetWare Core Protocol (NCP), and NetWare protocol used by the network. Gateway is also known as an IP router.

 

    What is the role of the host computer is a gateway?

 

    Suppose your name called the Little One, you live in a large yard, your neighbors have a lot of small partners, there is a janitor at the door to see the door of Lee uncle, Uncle Lee is your gateway. When you want the yard of a small partner to play, as long as you shout his name in the yard, he heard'll respond to you, and come out to play with you.

    But you are not allowed to walk out the door, you want all contact with the outside world, it must be made in front of Uncle Lee ( Gateway ) to help you contact by telephone. If you are looking for your little chat classmate Ming, Xiao Ming, who lives in another yard very far, his family's yard also has a janitor Uncle Wang (Xiao Ming gateway). But you do not know Xiao Ming home phone number, but you have a head teacher of all the students in your class list and phone number table, your teacher is your DNS server . So you called the front of Uncle Lee's phone at home, with the following dialogue:

    Little: Uncle Lee, I want to check the teacher Xiao Ming's phone number right?

    Uncle Lee: Well, you wait. (Uncle Lee then give you a teacher hung up the phone, I ask Xiao Ming phone) asked, his home number is 211.99.99.99

    Little: Great! Uncle Lee, I'm looking for Xiao Ming, you help me get in touch Xiaoming it.

    Uncle Lee: No problem. (Uncle Lee then issued a request to the telephone office home phone is turned request Xiaoming, the final hurdle of course is to be transferred to the yard of the home Xiao Ming Wang uncle there, and then go to the phone to Uncle Wang Xiaoming home)

    So you and Bob made contact.

    As DHCP server Well, can this analogy:

    Residents of your home yard more and more, where the janitor uncle Lee telephone switches can not meet the needs of so many residents, so had to use a new technology called DHCP, boot time residents were randomized to receive a phone call number, each time resulting numbers may be different.

    Lee uncle at your doorstep: is your gateway

    Your teacher: is your DNS server

    Janitor telephone exchange: is your DHCP server

    Ibid, dialogue between Grandpa and Uncle Wang Li called routing .

    Another: If there is a kids called the small dark, he lives yard porter is Sun uncle, because of the small dark courtyard just cover, Sun uncle first came shortly after he did Uncle Lee and Wang Grandpa office phone (Uncle Lee Wang and his uncle and certainly no phone), then there will be two situations:

    1, the neighborhood Aunt Zhao told the Sun uncle Lee on the phone, two king uncle (while Aunt Zhao told Li, Wang calls about Sun), this is called static routing settings

    2, Zhao aunt was sick, Sun uncle everywhere to call their own, telling anyone say: "I am a small dark courtyard tubes they call", the result was Li, Wang two heard, on the record in the address book on their and Li, Wang Sun uncle gave back the phone said: "I am Xiao Ming (little) pipe yard they call", which is called dynamic routing settings

    Then one day a small point to find small dark, with the result that small point to Lee uncle called and said: "Grandpa, I find a small dark" (omitted here Uncle Lee to investigate the process of small dark phone, assuming he knew little dark phone) Lee uncle to find a book: "Oh, small dark courtyard of the phone is Sun uncle of the tube, looking small dark nature must first notify Sun uncle, I can inform uncle Wang Sun uncle to let him go, you can own directly to the Sun, of course, it is easy to own directly to the Sun, "and then Lee Sun uncle uncle to a telephone call, then Sun uncle again calls to a small dark house.

    Uncle Lee's address book here called the routing table .

    Uncle Lee is his choice directly to Sun uncle let Uncle Wang called the help transit routing .

    Uncle Lee chose directly to the Sun uncle was justified, because he will be able to go directly to Sun uncle in one step, if you want to Uncle Wang adapter is required to complete two steps, where "step" is called " hops ", Li Grandpa's selection follows the minimum number of steps (number of hops) principle (if he does not comply with this principle, small point might wait some time to find a little dark, the end result may lead to Lee uncle who are incompetent to be fired, which is called "extended when too long, routing principles unreasonable, for a router ")

    Of course, things are always changing, Little Dot and Bob fight these days small point always to small dark call, Xiao Ming thought: "? Fuck, he is not saying bad things about me ah" So Bob decided to eavesdrop on a small point and small dark talk, but he can not out of the yard, how to do it? Xiao Ming made such a decision:

    First, he told himself backyard canal phones Uncle Wang said: "You make a phone call to Lee uncle said we moved to a small dark courtyard, after all his phone call to pick me," Uncle Wang did not reflect over (after all, older ! big ah) Lee uncle gave a telephone call, said: "now I manage a small dark phone, regardless of the Sun has been" the result uncle Lee put his contacts changed, this is called routing spoofing .

    After a small point to find small dark, Lee uncle were transferred to Uncle Wang the (in fact, should be transferred to Sun uncle), Uncle Wang received the phone transferred to Xiao Ming (because he previously had and Little said good), Xiao Ming received to the phone and pretend small dark small point communication. Because Xiao Ming guilty conscience, afraid after a small point and small dark to meet face to face to ask him tomorrow, so after the communication is broken, and that he in the name of a small point to the small dark through a phone call to repeat it again just said, there is this is called data eavesdropping .

    Still later, Little was constant and small dark ties and scattered Xiao Ming, Xiao Ming to himself ah: "I can not always do with identity and small small dark does not point call ah, outside a day revealed the secret of how to do!" So he want a more sinister tricks: "!! I simply do not eavesdrop on your phone, you are not a small point is not that you did not call me to let me give you a small dark can not play, hum," how he did it? Let's look:

    He contacted a group of fair-weather friends, and they collusion, a fixed time every day to everyone with small dark courtyard janitor's room to call, what the contents are, as long as the janitor Sun grandfather answer the phone, you will hear "thunder matter, under rain closing clothes ah! "," people are people born of his mother, the demon is the demon born of his mother "," mother name you "and so on, listen to the head are big, do not listen would not work, the phone rang non-stop what! Finally one day, Sun grandfather could not help, shouted: "I can not bear to pull !!!!", then hanged himself!

    This is the most simple DDOS attack , Sun grandfather weak mental capacity of a phenomenon called "datagram processing module BUG", Sun grandfather's suicide called "router paralysis." If it were me, would smile and they engaged in small talk, for example, tell them, "I had heard a weather forecast, 10 minutes before the clothes have received good" or "that your mother is a human or demon" or "your grandmother and a named "Wait, my kind of sound mind called" robust datagram processing, able to withstand any attack. "

    After Sun grandfather paralyzed, Little finally no longer to call a little dark, because no matter how busy he is to fight each other, a phenomenon called "denial of service", so there is a practice Xiaoming called "denial of service" .

    Xiao Ming finally quiet for a few days, ...

    A few days later, Xiao Ming yard to a beautiful girl called Mary, Bob liked her (young age, playing some kind of puppy love!) But Sarah has a handsome boyfriend, Xiao Ming can not look on in despair. Of course here is to follow the principle above: Mary is not out of the yard. The man want to soak Mary can only natural to call, so Xiao Ming and just around the corner:

    Remember grandfather was king of the yard telephone Explorer do? He has been able to manage because he had a telephone address book, because the same courtyard may have two children called Xiao Ming, can not be distinguished by name, so the only two contacts each line:

    Phone numbers

    One door 1234567 (this is Xiaoming)

    Gate 2 7654321 (this is Mary's)

    ......

    Grandpa Wang a bad memory, but this can not be wrong, right (with a yard there will be two "Gate 2", right)? People have to say each call to find a phone number, then knocked on the door to the yard through the address book, for example, people say I'm looking for "1234567", then a relatively Wang grandfather, oh, door number one, he One knock on the door, "Call", if it is looking for "7654321", and that he would find gate 2 "to the phone."

    Here's the phone number is the legendary "IP address"

    House number here is 'MAC' address legendary network card (MAC address of each card is not the same, which is the manufacturer of the card-coded into the chip card in)

    Xiao Ming thought, "Grandma, I can not you even think bubble bubble", so he contacts grandfather playing the king's idea, through careful observation, careful preparation, he finally found the king grandfather had frequent urination problems (after all the elderly ah ...), and finally in a dark and stormy month high during the day, Wang Grandpa go to the bathroom, and Xiao Ming secretly deep into the janitor's room, carefully grandfather changed the king's address book ......

    A few days later, Mary Mary's boyfriend gave the phone call, the other phone is reported "7654321" Grandpa Wang a look at contacts, by:

    Phone numbers

    One door 1234567 (this is Xiaoming)

    One door 7654321 (Note: This turned out to be Mary, but was changed Xiaoming)

    ......

    Wang grandfather changed ah do not know, so he went to Gate 1 small clear, the United States and Xiao Ming heart ah, Mary father to his tone stern lesson that man male-female relationships between Mary and unfair, the results of the man respectfully hung up the phone. Of course, Mary did not know the whole thing happened ...

    Xiao Ming's behavior here is called "ARP spoofing " (because in actual network by sending ARP packets to achieve, so called "ARP spoofing"), Wang Grandpa's address book is called "ARP Table"

    Here we must note: Grandpa Wang now have two address books, and is a record for each yard reception office phone books, called "routing table" , is a record of the books now that the yard For more information, called " ARP Table " .

    There is a famous saying, "People are always striving for perfection, although never be done" (Remember these words, because this is a big celebrity - that is, to me, say)

    Grandpa Wang's system there is one such book, "a month to re-check the house number and this corresponds to the phone (that is, the ARP)" This action is called " refresh the ARP table ", the time limit is called the month "cycle refresh the ARP table." Such Xiao Ming to let that man can never find Mary, secretly changed once every month after that address book, but this also had to do ah!

    Add that Xiao Ming is very clever, if the address book (ARP table) was changed to this:

    Numbers (MAC) telephone (IP) a

    Door No. 1234567 (this is Xiaoming)

    Gate 2 1234567 (Note: This is Xiao Ming changed, but he sometimes dizzy make mistakes)

    ......

    Would be the computer will pop up a dialog box prompts "duplicate IP address" will eventually lead to a loss grandfather king, then informed the Gate 1 and Gate 2, repeat your phone. Mary knew this was a good thing in her destruction, this phenomenon is called "the scam was exposed."

    Little knows he overheard Xiao Ming and small dark phone, so he agreed and small dark good password. Little told the little dark in the house to say after encryption. Potatoes -> Wednesday, sweet potatoes -> treat, stupid -> Little house. So Little told the little dark: potatoes, sweet potatoes fool. Xiao Ming listened to? ? ? Do not understand. . . . Depressed. . . This is encryption.

    In addition, Mary also know that Xiao Ming change his home phone number. So the king grandfather on the phone and a door to a house number down. And hide not allow outsiders to modify, only they have the key (password). This is the ip address and MAC address binding . When someone changed the phone number when you have to find Grandpa Wang changed. Trouble is trouble, but safe. But Xiao Ming Wang grandfather secretly to steal with a handful of key (password theft success), he can also be modified. So what, it is so.

    Gateway (Gateway), also known as gateways, protocol converters. Gateway in the transport layer are interconnected, it is the most complex of the internetworking devices, only two different high-level protocol for network interconnection. Gateway routers and similar structure, except that the interconnect layers. Gateway can be used for both WAN interconnection, it can also be used for LAN interconnection.

    Resolve inter-gateway technology

    The current IPV4 IP address is 32, according to the head of several subdivided into A, B, C three types of address; but because of the rapid development of INTERNET, IP depleting resources, available IP less and less, INTERNET serious conflict with the rapid development of, in the case of IPV6 far failed to fully upgrade, only by way of a proxy server, the implementation of internal network addresses with the public address transformation and achieve access INTERNET.

    The role of intermediary proxy server is a gateway, which is the gateway to bring this stage of multimedia communications systems endless trouble. In poor IP resources, only the gateway even multilayer gateway access to broadband networks, because the protocol multimedia communication systems such as H.323 and other parties to conduct the business must have an IP address of a network Fangyou Gong, but now there are several broadband users can meet this requirement? MICOSOFT of NETMEETING etc. multimedia communications systems is in such an awkward position; inter-gateway become a headache problem.

    Inter-gateway: data network gateway through the layers, subject to the gateway node speed, speed of the network is greatly reduced. Cross-gateway technology based on the underlying network protocol, the gateway to break the bottleneck to achieve customer point communication.

Published 29 original articles · won praise 13 · views 2745

Guess you like

Origin blog.csdn.net/zmx2473162621/article/details/103546844