{"id":847,"date":"2014-01-06T20:34:00","date_gmt":"2014-01-06T12:34:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=847"},"modified":"2023-11-06T20:49:41","modified_gmt":"2023-11-06T12:49:41","slug":"openflow","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/847","title":{"rendered":"Openflow"},"content":{"rendered":"\n<p>openflow 1.0<br>\u88ab\u5c01\u88dd\u5728TCP\u4e2d, Protocols in frame: eth:ip:tcp:of<\/p>\n\n\n\n<p><br><strong>flow\u8655\u7406\u7a0b\u5e8f<\/strong><br>packet\u9032\u5165openflow switch<br>\u5047\u5982\u7b26\u5408\u6307\u5b9a\u7684flow\u683c\u5f0f,\u5957\u7528\u6307\u5b9a\u7684actions<br>\u5047\u5982\u5b8c\u5168\u6c92\u6709\u7b26\u5408,\u5247\u900f\u904esecure channel\u50b3\u7d66controller<br>ps:<br>\u82e5\u5c01\u5305\u6c92\u6709\u7b26\u5408,\u53ea\u6703\u5c07\u5c01\u5305\u7684\u524d128bit\u50b3\u7d66controller<\/p>\n\n\n\n<p><strong>flow\u7684\u58fd\u547d<\/strong><br>\u6bcf\u500bflow\u6703\u4f9d\u64da\u4ee5\u4e0b\u5169\u7a2e\u65b9\u5f0f\u88ab\u522a\u9664<br>idle_timeout(\u8a72flow\u4e00\u76f4\u672a\u4f7f\u7528\u5247\u81ea\u52d5\u522a\u9664)<br>hard_timeout(\u6307\u5b9a\u6642\u9593\u4e00\u5230\u81ea\u52d5\u522a\u9664\u8a72flow,\u4e26\u767c\u51fa\u8a0a\u606f)<br>ps:<br>If both idle_timeout and hard_timeout are zero, the entry is considered permanent and will never time out<\/p>\n\n\n\n<p><strong>flow\u7684priority<\/strong><br>default is the highest priority<br>Higher priority entries must match before lower priority ones<br>If multiple entries have the same priority, the switch is free to choose any ordering<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<\/p>\n\n\n\n<p><strong>flow\u683c\u5f0f<\/strong><\/p>\n\n\n\n<p>flow\u683c\u5f0f<br><strong>[header][counters][actions]<\/strong><br>header<br>\u3000\u7528\u4f86\u6bd4\u5c0d\u662f\u5426\u70ba\u6307\u5b9a\u7684flow<br>counters:<br>\u3000\u7528\u4f86\u7d71\u8a08flow\u6578\u64da<br>actions:<br>\u3000\u9810\u8a2daction\u70ba\u4e1f\u68c4<br>\u3000\u82e5\u4e0d\u652f\u63f4\u5247\u56de\u61c9unspoorted flow error<br>\u3000\u4e00\u500bflow\u53ef\u4ee5\u6307\u5b9a\u591a\u500baction<\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p><strong>[header]<\/strong><br>\u6709\u4ee5\u4e0b\u6b04\u4f4d<br>ingress port(\u9032\u5165\u63a5\u53e3):<br>ether src<br>ether dst<br>ether type: 0x0806(arp), 0x0800(ip)<br>vlan id<br>vlan priority<br>ip src:\u4f86\u6e90ip,\u652f\u63f4mask<br>ip dst:\u76ee\u5730ip,\u652f\u63f4mask<br>ip proto: 1(icmp),6(tcp),17(udp)<br>ip tos bits<br>transport src port\/icmp type<br>transport dst port\/icmp code<\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p><strong>[counter]<\/strong><br>\u4f9d\u985e\u578b\u53ef\u5206\u70ba\u4ee5\u4e0b\u6b04\u4f4d<br>per table<br>\u3000active entires<br>\u3000packet lookups<br>\u3000packet matches<br>per flow<br>\u3000received packets<br>\u3000received bytes<br>\u3000duration(seconds)<br>\u3000duration(nanoseconds)<br>per port<br>\u3000received packets<br>\u3000transmitted packets<br>\u3000received bytes<br>\u3000transmitted bytes<br>\u3000receive drops<br>\u3000transmit drops<br>\u3000receive errors<br>\u3000transmit errors<br>\u3000receive frame alignment erros<br>\u3000receive overrun errors<br>\u3000receive CRC errors<br>\u3000collisions<br>per queue<br>\u3000transmit packets<br>\u3000transmit bytes<br>\u3000transmit overrun errors<\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p><strong>[actions]<\/strong><br>\u5206\u70barequired\u548coptional<\/p>\n\n\n\n<p><strong>Required Actions<\/strong>:\u8a2d\u5099\u5fc5\u9808\u652f\u63f4\u7684\u52d5\u4f5c<br><strong>forward<\/strong>:\u6709\u4ee5\u4e0b\u4e94\u7a2e<br>\u3000all \u5c07\u5c01\u5305\u9001\u5230\u6240\u6709port,\u4f46\u4e0d\u5305\u62ecinput port<br>\u3000controller \u5c07\u5b8c\u6574\u5c01\u5305\u5c01\u88dd\u4e26\u9001\u5230controller<br>\u3000local \u5c07\u5c01\u5305\u9001\u5230local switch\u7684networking stack<br>\u3000table \u5728flow table\u4e0a\u57f7\u884c\u76f8\u95dc\u52d5\u4f5c,\u4f46\u53ea\u5c0d\u9001\u51fa\u7684\u5c01\u5305\u6709\u4f5c\u7528<br>\u3000in_port: \u5c07\u5c01\u5305\u9001\u5230input port<br><strong>drop<\/strong>:\u82e5\u6c92\u6307\u5b9a\u7684\u9810\u8a2d\u52d5\u4f5c<\/p>\n\n\n\n<p><strong>Optional Actions<\/strong>:\u8a2d\u5099\u53ef\u80fd\u652f\u63f4\u7684\u52d5\u4f5c<br><strong>forward<\/strong>:\u6709\u4ee5\u4e0b\u4e8c\u7a2e<br>\u3000normal:\u4f9d\u50b3\u7d71switch\u7684\u65b9\u5f0f\u505a\u8655\u7406<br>\u3000flood:\u5c07\u5c01\u5305flooding,\u4f46\u4e0d\u5305\u542binput port,\u53ca\u88abstp\u95dc\u9589<br><strong>enqueue<\/strong>:\u5c07\u5c01\u5305\u8f49\u5230\u5230\u67d0\u500b\u4ecb\u9762\u7684queue,\u53ef\u7528\u4f86\u63d0\u4f9b\u57fa\u672c\u7684qos<br><strong>mudify-field<\/strong>:\u53ef\u4fee\u6539\u4ee5\u4e0b\u503c<br>\u3000set vlan id<br>\u3000set vlan priority<br>\u3000strip vlan header:\u62ff\u6389vlan\u8cc7\u8a0a<br>\u3000modify ether src addr<br>\u3000modify ether dst addr<br>\u3000modify ipv4 src addr<br>\u3000modify ipv4 dst addr<br>\u3000modify ipv4 tos bits<br>\u3000modify transport src port<br>\u3000modify transport dst port<\/p>\n\n\n\n<p><br>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<\/p>\n\n\n\n<p><strong>message<\/strong><br>\u6709\u4ee5\u4e0b\u4e09\u7a2e\u985e\u578b<br>controller-to-switch:\u7531controller\u767c\u51fa<br>asynchronous:\u7531switch\u8996\u72c0\u6cc1\u96a8\u6642\u50b3\u7d66controller\u7684\u8a0a\u606f<br>symmetric:\u7528\u4f86\u5efa\u7acb\u53ca\u7dad\u6301\u9023\u7dda\u7684\u8a0a\u606f<\/p>\n\n\n\n<p><br><strong>controller-to-switch<\/strong><br>\u4e3b\u8981\u6709<br>feature:\u8207switch\u5efa\u7acbtransport layer security session,\u53ef\u5206\u70ba\u5169\u7a2e<br>\u3000Controller-&gt;Switch:controller\u554fswitch\u8cc7\u8a0a<br>\u3000Switch-&gt;Controller:switch\u56de\u8986controller\u76f8\u95dc\u8cc7\u8a0a<br>configuration:\u8a2d\u5b9a\u6216\u67e5\u8a62switch<br>Modify-State:\u7ba1\u7406switch\u7684flow table,\u4e3b\u8981\u5de5\u4f5c\u70baadd,delete,modify flows<br>read-sate:\u7ba1\u7406switch\u7684flow table\u548c\u4ecb\u9762\u72c0\u614b<br>send-packet:\u7528\u4f86\u5c07packet\u9001\u5230switch<br>barrier:\u7528\u4f86\u78ba\u8a8d\u8a0a\u606f<\/p>\n\n\n\n<p><strong>asynchronous<\/strong><br>\u4e3b\u8981\u6709<br>packet-in:\u82e5switch\u767c\u73fe\u8a72packet\u4e0d\u5728flow table\u5167,\u5247\u900f\u904e\u8a72\u8a0a\u606f\u544a\u77e5controller<br>flow-removed:\u82e5switch\u767c\u73feflow\u5f9eflow table\u4e2d\u88ab\u79fb\u9664,\u5247\u901a\u77e5controller<br>port-status:\u82e5switch\u767c\u73feinterface\u8b8a\u5316(ex:\u4ecb\u9762shutdown),\u5247\u901a\u77e5controller<br>error:\u82e5switch\u767c\u73fe\u554f\u984c\u5247\u901a\u77e5controller<\/p>\n\n\n\n<p><strong>symmetric<\/strong><br>hello:switch\u548ccontroller\u7528\u4f86\u5efa\u7acb\u9023\u7dda,\u53ef\u5206\u70ba\u5169\u7a2e<br>\u3000Controller-&gt;Switch:controller\u50b3\u7d66switch<br>\u3000Switch-&gt;Controller:switch\u56de\u8986controller<br>echo:\u5224\u65b7controller\u6216switch\u662f\u5426\u9084\u5728\u7dda\u4e0a,\u5169\u4e00\u65b9\u5747\u53ef\u767c\u9001echo,\u63a5\u6536\u65b9\u9700\u56de\u5fa9echo reply\u4ee5\u78ba\u4fdd\u76ee\u524d\u4ecd\u4fdd\u6301\u9023\u63a5<br>vendor:\u4fdd\u7559<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<\/p>\n\n\n\n<p><br>ref:<br>https:\/\/www.opennetworking.org\/images\/stories\/downloads\/sdn-resources\/onf-specifications\/openflow\/openflow-spec-v1.0.0.pdf<br>OpenFlow Switching Performance: Not All TCAM Is Created Equal<br>http:\/\/packetpushers.net\/openflow-switching-performance-not-all-tcam-is-created-equal\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>openflow 1.0\u88ab\u5c01\u88dd\u5728TCP\u4e2d, Protocol &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[29],"tags":[],"class_list":["post-847","post","type-post","status-publish","format-standard","hentry","category-osi-layer7"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/847","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=847"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/847\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=847"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=847"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=847"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}