-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nat sample MAC address not correct #4
Comments
I traced the code to ForwardIPPacket in core/src/ip_out.c it appears line 55 assigned the saved dpdk1 MAC to haddr instead of client MAC. this would work in server side, but it could break in client side, maybe add a server or client side check condition to assign the MAC from pkt_ctx and go to fast_tx ? Am I on the right track?
|
Hi Vincent, The problem that I see in your setup is that the globally shared (public) IP address of the NAT should be different from the IP address of any of the middlebox IP addresses ( I think I should come up with a simpler method to set-up inline mode or automate the inline mode setup more. I will think of a way to make this more transparent. |
Vincent, I made a small update to the code which lets the mOS middlebox work fine in inline mode even if the interfaces are not assigned any IP addresses (reason mentioned in issue #1). When you run the script |
excellent! it works. the ifconfig command does not like IP address 0.0.0.0, so the setup.sh script complains error, but I used ip command like ip addr add 0.0.0.0/0 dev dpdk0, it works, maybe setup.sh script should use ip command instead of ifconfig ?
|
Thanks! I will make the update in my next commit. |
There I run the epserver and epwget,but those machines can't interactive data. Could you tell me why or how to build the environment. |
Hi Asim
I might may have misconfigured something for the NAT sample, so here again is my test example, let me know if I missed anything :)
client <---->dpdk0 mOS dpdk1 <---->server
client (IP 10.0.0.7, MAC 00:1b:21:50:bc:38 )
mOS (dpdk0 10.0.0.9 MAC a0:36:9f:a1:4d:6c, dpdk1 10.0.1.9 MAC A0:36:9F:A1:4D:6D)
server (IP 10.0.0.8, MAC 00:15:60:0e:3d:0a )
1, nat mos.conf
mos {
forward = 1
2, add server MAC in client and client MAC in server
client: #arp -i p1p1 -s 10.0.0.8 00:15:60:0e:3d:0a
server:
arp -i eth0 -s 10.0.0.7 00:1b:21:50:bc:38
arp -i eth0 -s 10.0.0.9 A0:36:9F:A1:4D:6D ( Note I had to add dpdk1 MAC for NAT IP 10.0.0.9 on server)
3, run nat
./nat -i 10.0.0.9
4, run curl on client
curl http://10.0.0.8/
client side capture:
09:42:47.809727 00:1b:21:50:bc:38 > 00:15:60:0e:3d:0a, ethertype IPv4 (0x0800), length 74: 10.0.0.7.37680 > 10.0.0.8.80: Flags [S], seq 1791631497.....
09:42:47.809987 a0:36:9f:a1:4d:6c > a0:36:9f:a1:4d:6d, ethertype IPv4 (0x0800), length 74: 10.0.0.8.80 > 10.0.0.7.37680: Flags [S.], seq 3146701557, ack 1791631498, ...
Note the problem here is:
SYN+ACK from mOS has source MAC of dpdk0 and destination MAC of dpdk1, instead of source MAC of dpdk0 and destination MAC of client, thus this result in SYN+ACK dropped by client.
4 server side capture:
09:45:56.065765 a0:36:9f:a1:4d:6d > 00:15:60:0e:3d:0a, ethertype IPv4 (0x0800), length 74: 10.0.0.9.1027 > 10.0.0.8.80: Flags [S], seq 1791631497...........
09:45:56.065865 00:15:60:0e:3d:0a > a0:36:9f:a1:4d:6d, ethertype IPv4 (0x0800), length 74: 10.0.0.8.80 > 10.0.0.9.1027: Flags [S.], seq 3146701557, ack 1791631498.............
server side source MAC and destination MAC looks ok for both SYN and SYN+ACK.
The text was updated successfully, but these errors were encountered: