D
D
Daniel2018-02-22 00:30:26
Computer networks
Daniel, 2018-02-22 00:30:26

What is the basic principle of sending IP packets to a specific node (host) on the Internet?

I am developing a decentralized network of connections between nodes (clients), and now I delved into computer networks, but the textbook was written in the last century.
In short, this is the task. There is a Client, it is connected to several other clients, and those to others in turn. A network is formed. Client A wants to send a request to client Z. He only knows his name on the network, he sends a request to all his clients to find a client, the same to his own, and so on. accordingly, the request is not sent, those clients to whom it has already been delivered, in short, bypass the Graph. After finding a client, that client forms a response to the source, and the source sends the message body.
It is necessary to optimize somehow, for example, if there are a million clients in the network, then each of them will receive a request, How the network is arranged, how it determines the route in the implementation
Perhaps by the time of the answer, I will have already found the answer, but still the advice of the guru will not hurt.
Request structure:
type -> Request type //in case of bypass find
target -> Name of the client on the network to be found
source -> Address : port of the Source, a response should be sent to it, from target
token -> Request indicator, set by visited nodes, and it is checked whether it was delivered before, in order to stop the request for this node
visits - an ordered list of visited nodes (so far, an extra ballast for the project)

5a8de28d5017f536434043.png

As a solution, I came up with only to limit the life of the package, divide them into a bunch how they will find the target, or, for example, will not be surrounded by visited nodes),
after several visits, ask the sender that he has not yet found the result)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dimonchik, 2018-02-22
@daniil14056

Well done Danil, you draw
the principle very well - any host has a default path (well, you may not have, in general) and a routing table - through which host to send to which network
in the simplest case, this table contains one line - native network (well, the second one - localhost) then
the host in any packet looks - does the address of the target network refer to someone in the table? if not, it throws it to the default node, on that node - everything is repeated, etc. until it reaches the target
ugh, with covered hands it can walk in a circle, for this there is ttl (or xs how, I forgot) with the passage of each node it decreases, who catches ttl 1 - drops the packet

S
Stanislav Bodrov, 2018-02-22
@jenki

How the network works
A bunch of autonomous systems with their own internal dynamic routing between network nodes. Usually over OSPF, maybe IS-IS or even IBGP. Within an AS, routers store information about all their cost routes to each subnet.
how it defines the route exactly in the implementation
ASs are interconnected using the BGP dynamic routing protocol. It differs in principle from the protocols inside the AS. A router configured with this protocol knows about routes only from neighboring routers. Depending on the BGP settings, traffic between autonomous systems will go one way or another and not always optimal (depending on how and what AS admins agree on). Further, traffic through the border router gets inside the desired AS, where it is directed along a defined path, which also may not always be the shortest.
Then the traffic reaches the desired router and is sent to the subscriber via the internal network.
For a better study of the topic, it is better to turn to a good resource , where much is clearly described.

Y
Yaroslav, 2018-02-22
@yaror

I understand correctly that:
- there is a certain Mesh-network (all-with-all) intended for the exchange of certain messages
- a communication channel between nodes - a direct TCP connection
- in case of a direct connection break, the possibility of a transit message should be provided
- the number nodes can be very large - possibly thousands of nodes
Right?
Then it makes sense to implement a routing scheme similar to that adopted in BGP.
I will move away from specifically network terminology and try to convey the essence.
So, each node has its own identifier - a name.
It is decoupled from its ip-addressing, and, in a good way, the same node can be accessed by several ip-addresses at the same time.
At the time of establishing a new connection between nodes, each of them tells the new neighbor both its name and the list of other nodes known to it with the shortest transit path to each of them.
Example:
The node "Vasya" is connected to the node "Peter".
At the moment of connection, "Vasya" reports:
I am "Vasya". I know how to get to:
- "Vasya", the shortest path: ""
- "Kolya", the shortest path: "Vasya"
- "Nastya", the shortest path: "Vasya, Kolya" (Perhaps there is an even longer route, but it is enough for us to report the shortest one)
"Petya" does the following:
- gives Vasya a similar list of nodes known to him with routes to them
- discards the routes received from "Vasya", in the shortest path to which he found his name (to avoid routing loops) route is shorter.
Potential pitfalls to consider:
1. Do not forget to inform neighbors about changes in your routing table:
- when a neighbor disappears
- when a new neighbor appears
- if the shortest route has changed for some possible recipient
2. Do not forget to discard routes in which you found himself
3. Since "loopback" is still possible due to incorrect operation of some nodes, a similar TTL mechanism is needed to limit the number of transit nodes that a message can go through before being destroyed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question