mosers
/
eaas-vde-proxy
Archiviert
1
0
Fork 0
main
Simon Moser vor 3 Jahren
Ursprung 93b48c9297
Commit fabae4938e
Signiert von: mosers
GPG-Schlüssel-ID: 96B3365A234B500C

Binäre Datei nicht angezeigt.

Nachher

Breite:  |  Höhe:  |  Größe: 20 KiB

@ -1,2 +1,76 @@
# eaas-vde-proxy
## Overview
![overview](README.assets/overview.png)
## Pseudocode
```python
class vde_proxy:
def handle_frame(frame):
try:
frame.mac = self.new_mac
except NameError:
self.new_mac = random_mac()
self.new_ip = do_dhcp(new_mac)
finally:
frame.mac = self.new_mac
frame.packet = handle_packet(frame.packet)
packet = frame.get_packet()
packet.ip = self.new_ip
def handle_packet(packet):
protocols = {
"ip" : handle_ip,
"arp": handle_arp,
}
return protocols[packet.protocol](packet)
def handle_ip(packet):
# Todo: Check DHCP lease and get new one if necessary
packet.ip = self.new_ip
if is_dhcp(packet):
packet = handle_dhcp(packet)
return packet
def handle_arp(packet):
pass
def handle_dhcp(packet):
pass
def do_dhcp(mac):
# Do DHCP
return ip
```
## Problematic protocols
Important:
* DHCP
* ARP
Nice to have:
* NetBEUI / NetBIOS
Keep in mind:
* IPv6 (NDP, Interface Identifier, ...)
* IPSec
* 802.1X
## Library support
### Go:
* Internet layer packet modification: https://github.com/google/gopacket / https://pkg.go.dev/github.com/google/gopacket
* Link layer frame modification: https://github.com/mdlayher/ethernet / https://pkg.go.dev/github.com/mdlayher/ethernet (not recently updated, alternative?)
### Rust:
* https://docs.rs/etherparse/0.9.0/etherparse