Fix nhop_dmac in load-balance/s1-runtime.json#619
Conversation
|
@stano45 Would you be able to also update the |
|
@rst0git I assumed the |
|
@stano45 I believe that addresses in the format "hosts": {
"h1": {
"ip": "10.0.1.1/24",
"mac": "08:00:00:00:01:01",
"commands": [
"route add default gw 10.0.1.10 dev eth0",
"arp -i eth0 -s 10.0.1.10 08:00:00:00:01:00"
]
},
"h2": {
"ip": "10.0.2.2/24",
"mac": "08:00:00:00:02:02",
"commands": [
"route add default gw 10.0.2.20 dev eth0",
"arp -i eth0 -s 10.0.2.20 08:00:00:00:02:00"
]
},
"h3": {
"ip": "10.0.3.3/24",
"mac": "08:00:00:00:03:03",
"commands": [
"route add default gw 10.0.3.30 dev eth0",
"arp -i eth0 -s 10.0.3.30 08:00:00:00:03:00"
]
}
}The |
|
I wanted to suggest another idea, to see if you think it has merit: Unlike traditional Ethernet switches and IP routers, it is easy to write P4 programs, especially exercises like the ones found in this repo, that DO NOT HAVE TO abide by what a real commercially supported device would do. For example, if you wanted to, you could make an IP router that used the Ethernet header source and destination MAC addresses contain 2*48=96 bits of arbitrary data, used for purposes completely different than a commercially-supported device would. Perhaps it might be nice in one of the tutorials exercises README's to explicitly point that out? Then we could also mention that while the table entries might not have what appear to be the kinds of entries you would see in a commercially-supported Ethernet switch, but this is intentionally done to emphasize this property of P4-programmable devices? |
@rst0git Ah okay now I understand. I will update the PR accordingly. |
@jafingerhut I think that's a good idea. Maybe we could mention this in one of the earlier exercises, so that anyone working through the tutorials already understands at the beginning that P4 is protocol-independent (and not necessarily required to use standard MAC addresses). What do you think? |
I like that idea. I do not have a recommendation right now for which exercise that might be. Note that it is easier in some exercises to redefine the meaning of Ethernet MAC addresses between P4-programmable switches, than it might be between a switch and a host, because the emulated hosts probably do have certain requirements about the destination MAC address of packets they accept. |
Corrected the
nhop_dmacfields ins1-runtime.json. The MAC addresses of the hosts should start with08, as defined intopology.json.This actually didn't matter for forwarding, since the
nhop_dmacwas correct in the runtime files of s2 and s3, but still this could confuse someone examining the file.I tested the change locally.