Question from Nikita about mesh

ESP_Alen

Question from Nikita about mesh

Postby ESP_Alen » Tue May 24, 2016 9:02 pm

The most important for me is about routing!

thanks!
1) what is the method of dynamic routing? which criterias nodes are uses to find best route?
2) Server just print that he is available and thats all? So how can I monitor the proses of mesh working? Where and how can I investigate bits in packets as you do it in ESP8266 Mesh User Guide?
3) I still cant understand where to look for such prints))

mesh will print "**** mesh is busy"


4) where in code should I look for description of events that are wreaten in README file such as
2. Every node sends one packet to server per 7 seconds after it joins mesh network.
3. Every node gets mac address of all devices working in mesh per 14 seconds after it joins mesh?

5) Finally what is the procedure of election root and non root node?


Response:
    1. There is just one path from one node to anther node, the router path is established during the mesh establishment.
    2. You can print more information when you receive packet from node.
    Now, the server will print packet content when it receive packet, please pay attention to the line 14 of demo_server.py
    You may pay attention to line 17 ~ 27 of demo_server.py, they are the packet format.
    3. mesh just hold one packet from user, before it send the packet out, if user try to send another packet, you will get the indication "mesh is busy"
    4. Please pay attention to esp_mesh_demo_test in mesh_demo.c, the test case will send one packet to server per 7 seconds.
    at the same time, mesh_topo_test in mesh_none.c, it is the case to send topology request packet to get all device working in mesh per 14 seconds.
    5. You can make one device as root according to your plan, or contest for root automatically.
    If you select contest solution, all the node will try to as root device, and we implement solution to check the conflict of root.
    The RSSI and current capacity of node will determine the final root.
    The root with max RSSI and most capacity continues as root, the other root would not be as root, and re-join mesh as non-root device.

Nikita Belyaev
Posts: 15
Joined: Wed May 18, 2016 11:09 pm

Re: Question from Nikita about mesh

Postby Nikita Belyaev » Tue May 24, 2016 9:50 pm

Alen wrote:
The most important for me is about routing!

thanks!
1) what is the method of dynamic routing? which criterias nodes are uses to find best route?
2) Server just print that he is available and thats all? So how can I monitor the proses of mesh working? Where and how can I investigate bits in packets as you do it in ESP8266 Mesh User Guide?
3) I still cant understand where to look for such prints))

mesh will print "**** mesh is busy"


4) where in code should I look for description of events that are wreaten in README file such as
2. Every node sends one packet to server per 7 seconds after it joins mesh network.
3. Every node gets mac address of all devices working in mesh per 14 seconds after it joins mesh?

5) Finally what is the procedure of election root and non root node?


Response:
    1. There is just one path from one node to anther node, the router path is established during the mesh establishment.
    2. You can print more information when you receive packet from node.
    Now, the server will print packet content when it receive packet, please pay attention to the line 14 of demo_server.py
    You may pay attention to line 17 ~ 27 of demo_server.py, they are the packet format.
    3. mesh just hold one packet from user, before it send the packet out, if user try to send another packet, you will get the indication "mesh is busy"
    4. Please pay attention to esp_mesh_demo_test in mesh_demo.c, the test case will send one packet to server per 7 seconds.
    at the same time, mesh_topo_test in mesh_none.c, it is the case to send topology request packet to get all device working in mesh per 14 seconds.
    5. You can make one device as root according to your plan, or contest for root automatically.
    If you select contest solution, all the node will try to as root device, and we implement solution to check the conflict of root.
    The RSSI and current capacity of node will determine the final root.
    The root with max RSSI and most capacity continues as root, the other root would not be as root, and re-join mesh as non-root device.


Dear Alen,thanks a lot for such detailed answer!
However,let's talk more about routing))

Imagine such small network:
(1)---(2)---(3)---(4)
.........|.....|
........(5)---(6)


Node 1 desire to send a packet to 6. How this packet will go through other nodes? How node 2 know that he should forward this packet to 5 not to 6?

ESP_Alen

Re: Question from Nikita about mesh

Postby ESP_Alen » Tue May 24, 2016 10:54 pm

Nikita Belyaev wrote:
Alen wrote:
The most important for me is about routing!

thanks!
1) what is the method of dynamic routing? which criterias nodes are uses to find best route?
2) Server just print that he is available and thats all? So how can I monitor the proses of mesh working? Where and how can I investigate bits in packets as you do it in ESP8266 Mesh User Guide?
3) I still cant understand where to look for such prints))

mesh will print "**** mesh is busy"


4) where in code should I look for description of events that are wreaten in README file such as
2. Every node sends one packet to server per 7 seconds after it joins mesh network.
3. Every node gets mac address of all devices working in mesh per 14 seconds after it joins mesh?

5) Finally what is the procedure of election root and non root node?


Response:
    1. There is just one path from one node to anther node, the router path is established during the mesh establishment.
    2. You can print more information when you receive packet from node.
    Now, the server will print packet content when it receive packet, please pay attention to the line 14 of demo_server.py
    You may pay attention to line 17 ~ 27 of demo_server.py, they are the packet format.
    3. mesh just hold one packet from user, before it send the packet out, if user try to send another packet, you will get the indication "mesh is busy"
    4. Please pay attention to esp_mesh_demo_test in mesh_demo.c, the test case will send one packet to server per 7 seconds.
    at the same time, mesh_topo_test in mesh_none.c, it is the case to send topology request packet to get all device working in mesh per 14 seconds.
    5. You can make one device as root according to your plan, or contest for root automatically.
    If you select contest solution, all the node will try to as root device, and we implement solution to check the conflict of root.
    The RSSI and current capacity of node will determine the final root.
    The root with max RSSI and most capacity continues as root, the other root would not be as root, and re-join mesh as non-root device.


Dear Alen,thanks a lot for such detailed answer!
However,let's talk more about routing))

Imagine such small network:
(1)---(2)---(3)---(4)
.........|.....|
........(5)---(6)

Node 1 desire to send a packet to 6. How this packet will go through other nodes? How node 2 know that he should forward this packet to 5 not to 6?


Node 1 sends packet to Node 2, Node 2 forwards packet to Node 3 according its route table, then Node 3 forwards packet to Node 6.
Node 2 doesn't forward packet to Node 5, because there is only one path from Node 1 to Node 6.

In addition, Node 1 doesn't know every detail hop to Node 6, it just knows that Node 2 is only path to Node 6.

Nikita Belyaev
Posts: 15
Joined: Wed May 18, 2016 11:09 pm

Re: Question from Nikita about mesh

Postby Nikita Belyaev » Wed May 25, 2016 1:20 am

Alen wrote:
Nikita Belyaev wrote:
Alen wrote:
Dear Alen,thanks a lot for such detailed answer!
However,let's talk more about routing))

Imagine such small network:
(1)---(2)---(3)---(4)
.........|.....|
........(5)---(6)

Node 1 desire to send a packet to 6. How this packet will go through other nodes? How node 2 know that he should forward this packet to 5 not to 6?


Node 1 sends packet to Node 2, Node 2 forwards packet to Node 3 according its route table, then Node 3 forwards packet to Node 6.
Node 2 doesn't forward packet to Node 5, because there is only one path from Node 1 to Node 6.

In addition, Node 1 doesn't know every detail hop to Node 6, it just knows that Node 2 is only path to Node 6.


If thee is only one path between 2 nodes,why do u call its mesh??? It's just tree!
In pdf,that comes in documents from git is written that:
There are three schemes to implement mesh:
1) mesh between App. layer and TCP layer
2) mesh between IP and MAC layers
3)...

How can I change between them? And which one is realized in mesh_demo??
I still can't understand routing procedure.
If we use mesh upon TCP we can't work with mac adr.,only IP (maybe I'm nor right)
How does routing table looks like?

ESP_Alen

Re: Question from Nikita about mesh

Postby ESP_Alen » Wed May 25, 2016 1:03 pm

    1. Yes, it's just a tree; Now, we just implement mesh between App. layer and TCP layer.
    2. the element of route table is mac address, because the IP address of device is not unique.
    We use mac address to forward packet.
    You can get detail information about mesh format from document you mentioned above.

Nikita Belyaev
Posts: 15
Joined: Wed May 18, 2016 11:09 pm

Re: Question from Nikita about mesh

Postby Nikita Belyaev » Wed May 25, 2016 5:28 pm

Alen wrote:
    1. Yes, it's just a tree; Now, we just implement mesh between App. layer and TCP layer.
    2. the element of route table is mac address, because the IP address of device is not unique.
    We use mac address to forward packet.
    You can get detail information about mesh format from document you mentioned above.


Thanks for your answer!

Sadly that its not mesh(((

I do not understand!
you implement mesh between App. layer and TCP layer, but using mac adr.,who are uses only on MAC layer.

does it mean that you have created distributed application if your "mesh" works upon tcp layer?

(1)---(2)---(3)---(4)
..........|......|
........(5).....(6)

Can we say that in case of necessary to transmit data from 1 to 6 they establish tcp connection with each and there can exist only one connection in network at the same time?

If two nods want to send data at the same time?
Which protocol is using on MAC layer to control access to media?

do u have any idea how to send data from server to desired node and push that data to pc via uart?

ESP_Alen

Re: Question from Nikita about mesh

Postby ESP_Alen » Wed May 25, 2016 7:05 pm

I do not understand!
you implement mesh between App. layer and TCP layer, but using mac adr.,who are uses only on MAC layer.

does it mean that you have created distributed application if your "mesh" works upon tcp layer?

(1)---(2)---(3)---(4)
..........|......|
........(5).....(6)

Can we say that in case of necessary to transmit data from 1 to 6 they establish tcp connection with each and there can exist only one connection in network at the same time?

If two nods want to send data at the same time?
Which protocol is using on MAC layer to control access to media?

do u have any idea how to send data from server to desired node and push that data to pc via uart?


1. Yes, we implement distributed application, and node just uses MAC to forward packet, the data packet is sent using TCP.
2. Every red line represents one TCP connection in topology map.
3. Please build packet according to the mesh format, and then send the packet to root device.
The packet will forwarded to destination device.
When destination device receive packet, it can transmit packet to PC using UART.

Nikita Belyaev
Posts: 15
Joined: Wed May 18, 2016 11:09 pm

Re: Question from Nikita about mesh

Postby Nikita Belyaev » Wed May 25, 2016 7:14 pm

Alen wrote:
I do not understand!
you implement mesh between App. layer and TCP layer, but using mac adr.,who are uses only on MAC layer.

does it mean that you have created distributed application if your "mesh" works upon tcp layer?

(1)---(2)---(3)---(4)
..........|......|
........(5).....(6)

Can we say that in case of necessary to transmit data from 1 to 6 they establish tcp connection with each and there can exist only one connection in network at the same time?

If two nods want to send data at the same time?
Which protocol is using on MAC layer to control access to media?

do u have any idea how to send data from server to desired node and push that data to pc via uart?


1. Yes, we implement distributed application, and node just uses MAC to forward packet, the data packet is sent using TCP.
2. Every red line represents one TCP connection in topology map.
3. Please build packet according to the mesh format, and then send the packet to root device.
The packet will forwarded to destination device.
When destination device receive packet, it can transmit packet to PC using UART.


Thanks a lot!
Thats i was waiting from u))

But what about pre last question about protocol on mac?

further more:
1. mesh inside is using wi-fi to connect nodes. how do they chose wifi channel?
2. this line in server.py doesnt work

Code: Select all

self.buf = bytearray()
        print(self)

my local ip is 192.168.1.38, so i set it

Code: Select all

HOST, PORT = "192.168.1.38", 7000

what I'm doing wrong?

ESP_Alen

Re: Question from Nikita about mesh

Postby ESP_Alen » Wed May 25, 2016 7:41 pm

Thanks a lot!
Thats i was waiting from u))

But what about pre last question about protocol on mac?

further more:
1. mesh inside is using wi-fi to connect nodes. how do they chose wifi channel?
2. this line in server.py doesnt work
CODE: SELECT ALL
self.buf = bytearray()
print(self)

my local ip is 192.168.1.38, so i set it
CODE: SELECT ALL
HOST, PORT = "192.168.1.38", 7000

what I'm doing wrong?


1. which question ?
2. all the nodes use the same channel with router.
3. could you paste the your server.py here ?

Nikita Belyaev
Posts: 15
Joined: Wed May 18, 2016 11:09 pm

Re: Question from Nikita about mesh

Postby Nikita Belyaev » Wed May 25, 2016 9:33 pm

Alen wrote:
Thanks a lot!
Thats i was waiting from u))

But what about pre last question about protocol on mac?

further more:
1. mesh inside is using wi-fi to connect nodes. how do they chose wifi channel?
2. this line in server.py doesnt work
CODE: SELECT ALL
self.buf = bytearray()
print(self)

my local ip is 192.168.1.38, so i set it
CODE: SELECT ALL
HOST, PORT = "192.168.1.38", 7000

what I'm doing wrong?


1. which question ?
2. all the nodes use the same channel with router.
3. could you paste the your server.py here ?


This one - Which protocol is using on MAC layer to control access to media?
Also have such question - u have marked all connections red and said its TCP. Does this TCP connections are sets on demand or they are establish for all the time?

My server.py is same with your from git

Code: Select all

#!/usr/bin/env python

import sys
import struct
if sys.version_info[0] < 3:
    import SocketServer as socketserver
else:
    import socketserver

class MeshHandler(socketserver.BaseRequestHandler):

    def handle(self):
        self.buf = bytearray()
        print(self)
        try:
            while True:
                header = self.read_full(4)
                l, = struct.unpack_from('<H', header[2:4])
                body = self.read_full(l-4)
                req = bytearray()
                req.extend(header)
                req.extend(body)
                resp = bytearray()
                resp.extend(req[0:4])
                resp.extend(req[10:16])
                resp.extend(req[4:10])
                resp.extend(req[16:])
                self.request.sendall(resp)
        except Exception as e:
            print(e)

    def read_full(self, n):
        while len(self.buf) < n:
            try:
                req = self.request.recv(1024)
                if not req:
                    raise(Exception('recv error'))
                self.buf.extend(req)
            except Exception as e:
                raise(e)
        read = self.buf[0:n]
        self.buf = self.buf[n:]
        return bytes(read)

class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
    pass

if __name__ == "__main__":
    HOST, PORT = "192.168.1.38", 7000
    server = ThreadedTCPServer((HOST, PORT), MeshHandler)
    server.allow_reuse_address = True
    print('mesh server works')
    server.serve_forever()



Thanks for help!

Who is online

Users browsing this forum: No registered users and 17 guests