You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Raw socket is a layer 2 python library for communication using the MAC addresses only.
5
+
Raw socket is a layer 2 python library for communication using the MAC addresses only.
6
6
7
7
This allows you to create a custom made Ethernet/WiFi communication system which is **not** using IP nor TCP/UDP or to debug custom frames such as SERCOS III, Profibus, ARP, PTP, ...
8
8
9
9
Python versions tested:
10
10
11
11
-[x] 2.7.x
12
-
-[ ] 3.5.x - Reimplement to_bytes for Socket.send
12
+
-[x] 3.5.x
13
+
-[x] 3.8.x
13
14
14
15
OSes:
15
16
16
-
-[] Linux 14.04
17
+
-[x] Linux 14.04
17
18
-[x] Linux 16.04
18
-
-[ ] Linux 18.04
19
-
-[ ] Windows 10
20
-
-[ ] Mac OSX
19
+
-[x] Linux 18.04
20
+
-[x] Linux 20.04
21
+
22
+
Not working on:
23
+
-[ ] Windows 10 - Due to Raw socket limitation
24
+
-[ ] Mac OSX - Due to implementation (can likely be made working)
21
25
22
26
**Pros:**
23
27
@@ -36,7 +40,7 @@ OSes:
36
40
- No encryption
37
41
- No fragmentation
38
42
-**Requires root**
39
-
- MTU of 1500
43
+
- MTU of 1500 (Ethernet frames)
40
44
41
45
## Installation
42
46
@@ -63,7 +67,7 @@ while True: print(sock.recv())"
63
67
# Boo
64
68
```
65
69
66
-
On the second computer over the same router:
70
+
On **the second computer** over the same router (or same network on Zerotier):
67
71
68
72
```bash
69
73
sudo python -c "from rawsocketpy import RawSocket; import time
@@ -81,7 +85,7 @@ from rawsocketpy import RawSocket
81
85
82
86
# 0xEEFA is the ethertype
83
87
# The most common are available here: https://en.wikipedia.org/wiki/EtherType
84
-
# The full official list is available here: https://regauth.standards.ieee.org/standards-ra-web/pub/view.html#registries
88
+
# The full official list is available here: https://regauth.standards.ieee.org/standards-ra-web/pub/view.html#registries
85
89
# Direct link: https://standards.ieee.org/develop/regauth/ethertype/eth.csv
86
90
# You can use whatever you want but using a already use type can have unexpected behaviour.
87
91
sock = RawSocket("wlp2s0", 0xEEFA)
@@ -127,7 +131,7 @@ class LongTaskTest(RawRequestHandler):
127
131
print("End")
128
132
129
133
defsetup(self):
130
-
print("Begin")
134
+
print("Begin")
131
135
132
136
defmain():
133
137
rs = RawServer("wlp2s0", 0xEEFA, LongTaskTest)
@@ -161,7 +165,7 @@ class LongTaskTest(RawRequestHandler):
Copy file name to clipboardExpand all lines: rawsocketpy/__init__.py
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,16 @@
3
3
4
4
"""A Raw socket implementation allowing any ethernet type to be used/sniffed.
5
5
6
-
If gevent is available, sockets are monkey patched and two additionnal asynchronous server implementations are available: :class:`RawAsyncServer`, :class:`RawAsyncServerCallback`
6
+
If gevent is available, sockets are monkey patched and two additionnal asynchronous server implementations are available: :class:`RawAsyncServer`, :class:`RawAsyncServerCallback`
0 commit comments