日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

OVS中arp响应的流表的实现

發布時間:2024/4/17 编程问答 36 豆豆
生活随笔 收集整理的這篇文章主要介紹了 OVS中arp响应的流表的实现 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

總結:

1、br-int 流表總體是按照Normal 的方式,即常規的交換機的轉發方式進行轉發。而br-tun 交換機則主要按照流表的方式進行轉發。

2、一般情況下,VM發出的ARP請求,會在該VM的所有鄰居進行廣播發送和查找,大量浪費帶寬。當neutron開啟了l2 pop后(二次注入功能),

計算節點會學習別的主機發送的免費ARP, 從而在本地存在ARP表項。

3、當本地的VM發出ARP請求時,br-tun交換機會優先查找本地的ARP表項,從而對報文進行ARP應答。

這樣的話,就不用發出ARP請求的廣播報文。如果br-tun交換機查找不到對應的ARP響應流表,則按照普通的隧道廣播的方式進行正常廣播發送。

4、ARP響應流表的匹配條件和動作分別如下:

  • ARP響應流表的匹配條件是:
br.add_flow(table=constants.ARP_RESPONDER,
priority=1,
proto='arp',
dl_vlan=vlan,
nw_dst='%s' % ip,
actions=actions)
  • ARP響應流表的動作如下:
ARP_RESPONDER_ACTIONS = ('move:NXM_OF_ETH_SRC[]->NXM_OF_ETH_DST[],'
'mod_dl_src:%(mac)s,'
'load:0x2->NXM_OF_ARP_OP[],'
'move:NXM_NX_ARP_SHA[]->NXM_NX_ARP_THA[],'
'move:NXM_OF_ARP_SPA[]->NXM_OF_ARP_TPA[],'
'load:%(mac)#x->NXM_NX_ARP_SHA[],'
'load:%(ip)#x->NXM_OF_ARP_SPA[],'
'in_port')
5、對匹配條件和動作的解釋如下:

self.tun_br.add_flow(table=constants.ARP_RESPONDER,?– Add this new flow to the ARP_RESPONDER table

?????????????????????????????????priority=1,?– With a priority of 1 (Another, default flow with the lower priority of 0 is added elsewhere in the code)

?????????????????????????????????proto=‘arp’,?– Match only on ARP messages

?????????????????????????????????dl_vlan=lvid,?– Match only if the destination VLAN (The message has been locally VLAN tagged by now) matches the VLAN ID / network of the remote VM

?????????????????????????????????nw_dst=%s‘?%?ip,?– Match?on the IP address of the remote VM in question

?????????????????????????????????actions=actions)

actions?=?(‘move:NXM_OF_ETH_SRC[]->NXM_OF_ETH_DST[],’?– Place the source MAC address of the request (The requesting VM) as the new reply’s destination MAC address

???????????????????????‘mod_dl_src:%(mac)s,’?– Put the requested MAC address of the remote VM as this message’s source MAC address

???????????????????????‘load:0x2->NXM_OF_ARP_OP[],’?– Put an 0x2 code as the type of the ARP message. 0x2 is an ARP response.

???????????????????????‘move:NXM_NX_ARP_SHA[]->NXM_NX_ARP_THA[],’?– Place the ARP request’s source hardware address (MAC) as this new message’s ARP target / destination hardware address

???????????????????????‘move:NXM_OF_ARP_SPA[]->NXM_OF_ARP_TPA[],’?– Place the ARP request’s source protocol / IP address as the new message’s ARP destination IP address

???????????????????????‘load:%(mac)#x->NXM_NX_ARP_SHA[],’?– Place the requested VM’s MAC address as the source MAC address of the ARP reply

???????????????????????‘load:%(ip)#x->NXM_OF_ARP_SPA[],’?– Place the requested VM’s IP address as the source IP address of the ARP reply

???????????????????????‘in_port’?%?{‘mac’:?mac,?‘ip’:?ip})?– Forward the message back to the port it came in on


6、參考blog: OVS ARP Responder – Theory and Practice https://assafmuller.com/2014/05/21/ovs-arp-responder-theory-and-practice/

轉載于:https://www.cnblogs.com/zhouhaibing/p/7442205.html

總結

以上是生活随笔為你收集整理的OVS中arp响应的流表的实现的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。