CN105812502A - OpenFlow-based implementation method for address resolution protocol proxy technology - Google Patents
OpenFlow-based implementation method for address resolution protocol proxy technology Download PDFInfo
- Publication number
- CN105812502A CN105812502A CN201610127935.5A CN201610127935A CN105812502A CN 105812502 A CN105812502 A CN 105812502A CN 201610127935 A CN201610127935 A CN 201610127935A CN 105812502 A CN105812502 A CN 105812502A
- Authority
- CN
- China
- Prior art keywords
- host
- address
- dhcp
- controller
- lease
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/10—Mapping addresses of different types
- H04L61/103—Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/25—Mapping addresses of the same type
- H04L61/2503—Translation of Internet protocol [IP] addresses
- H04L61/2521—Translation architectures other than single NAT servers
- H04L61/2528—Translation at a proxy
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5076—Update or notification mechanisms, e.g. DynDNS
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/59—Network arrangements, protocols or services for addressing or naming using proxies for addressing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2101/00—Indexing scheme associated with group H04L61/00
- H04L2101/60—Types of network addresses
- H04L2101/618—Details of network addresses
- H04L2101/622—Layer-2 addresses, e.g. medium access control [MAC] addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2212/00—Encapsulation of packets
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5007—Internet protocol [IP] addresses
- H04L61/5014—Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
基于OpenFlow的地址解析协议代理技术的实现方法属于网络通信领域。OpenFlow技术通过分离网络的数据平面和控制平面,为网络创新提供了平台和工具。基于OpenFlow管控分离的架构,在控制器POX上进行软件编程,设计实现了功能强大的ARP代理服务。在OpenFlow网络环境下,通过对上传到控制器的DHCP数据包进行解析,将主机IP,主机MAC,主机端口号等数据自动提取出来建立一张主机信息绑定表。主机信息表建立后,使OpenFlow控制器代理回复ARP请求,方便高效的解决两主机之间的通信的问题。另一方面绑定表也可以用来判断发往控制器的数据包是否合法,从而实现对合法报文正常转发,非法报文丢弃的功能,大大提升了系统的安全性。
The invention relates to an implementation method of an address resolution protocol proxy technology based on OpenFlow, which belongs to the field of network communication. OpenFlow technology provides a platform and tools for network innovation by separating the data plane and control plane of the network. Based on the architecture of OpenFlow management and control separation, software programming is performed on the controller POX, and a powerful ARP proxy service is designed and implemented. In the OpenFlow network environment, by analyzing the DHCP data packet uploaded to the controller, the host IP, host MAC, host port number and other data are automatically extracted to establish a host information binding table. After the host information table is established, the OpenFlow controller is made to reply the ARP request as an agent, so as to solve the communication problem between the two hosts conveniently and efficiently. On the other hand, the binding table can also be used to judge whether the data packets sent to the controller are legal, so as to realize the normal forwarding of legal packets and the discarding of illegal packets, which greatly improves the security of the system.
Description
技术领域technical field
本发明属于计算机网络技术领域。The invention belongs to the technical field of computer network.
背景技术Background technique
传统IT架构中的网络,根据业务需求部署上线以后,如果业务需求发生变动,重新修改相应网络设备(路由器、交换机、防火墙)上的配置是一件非常繁琐的事情。在互联网/移动互联网瞬息万变的业务环境下,网络的高稳定与高性能还不足以满足业务需求,灵活性和敏捷性反而更为关键。SDN所做的事是将网络设备上的控制权分离出来,由集中的控制器管理,无须依赖底层网络设备(路由器、交换机、防火墙),屏蔽了来自底层网络设备的差异。而控制权是完全开放的,用户可以自定义任何想实现的网络路由和传输规则策略,从而更加灵活和智能。After the network in the traditional IT architecture is deployed and launched according to business needs, if the business needs change, it is very cumbersome to re-modify the configuration on the corresponding network devices (routers, switches, firewalls). In the rapidly changing business environment of the Internet/mobile Internet, the high stability and high performance of the network are not enough to meet business needs, and flexibility and agility are more critical. What SDN does is to separate the control rights on the network devices and manage them by a centralized controller without relying on the underlying network devices (routers, switches, firewalls), shielding the differences from the underlying network devices. The control right is completely open, and users can customize any network routing and transmission rules and strategies they want to achieve, making it more flexible and intelligent.
进行SDN改造后,无需对网络中每个节点的路由器反复进行配置,网络中的设备本身就是自动化连通的。只需要在使用时定义好简单的网络规则即可。如果你不喜欢路由器自身内置的协议,可以通过编程的方式对其进行修改,以实现更好的数据交换性能。After the SDN transformation, there is no need to repeatedly configure the routers of each node in the network, and the devices in the network are automatically connected. You only need to define simple network rules when using it. If you don't like the router's own built-in protocol, you can modify it programmatically to achieve better data exchange performance.
在香港、美国已经非常流行的云主机概念在我国也慢慢开始崭露头角,云主机是云计算在基础设施应用上的重要组成部分,位于云计算产业链金字塔底层,产品源自云计算平台。该平台整合了互联网应用三大核心要素:计算、存储、网络,面向用户提供公用化的互联网基础设施服务。云主机是一种类似VPS主机的虚拟化技术,VPS是采用虚拟软件,VZ或VM在一台主机上虚拟出多个类似独立主机的部分,能够实现单机多用户,每个部分都可以做单独的操作系统,管理方法同主机一样。而云主机是在一组集群主机上虚拟出多个类似独立主机的部分,集群中每个主机上都有云主机的一个镜像,从而大大提高了虚拟主机的安全稳定性,除非所有的集群内主机全部出现问题,云主机才会无法访问。The concept of cloud host, which has been very popular in Hong Kong and the United States, has gradually begun to emerge in my country. Cloud host is an important part of cloud computing in infrastructure applications. It is located at the bottom of the pyramid of the cloud computing industry chain, and its products come from cloud computing platforms. The platform integrates three core elements of Internet applications: computing, storage, and network, and provides public Internet infrastructure services for users. Cloud host is a virtualization technology similar to VPS host. VPS uses virtual software. VZ or VM virtualizes multiple parts similar to independent hosts on one host. operating system, the management method is the same as that of the host. The cloud host is to virtualize multiple parts similar to independent hosts on a group of cluster hosts. Each host in the cluster has a mirror image of the cloud host, which greatly improves the security and stability of the virtual host. If there is a problem with all the hosts, the cloud host will be inaccessible.
值得一提的是企业在租用云主机的时候,其租用的所有主机可能并不在一个数据中心,甚至不在一个城市。那么企业租用的云主机的物理网络可能并不在相同网段,虽然在企业内部所有租用的云主机都是在相同网段之下。那么在物理网络中不同网段的云主机在企业网络中如何进行通信,就成了一件十分复杂的事情。It is worth mentioning that when an enterprise rents a cloud host, all the hosts it leases may not be located in a data center, or even in a city. Then the physical network of the cloud host rented by the enterprise may not be in the same network segment, although all the cloud hosts rented in the enterprise are under the same network segment. Then how cloud hosts on different network segments in the physical network communicate in the enterprise network has become a very complicated matter.
我们已经知道要进行主机间通信,则必须先发出ARP请求获取到目的主机的MAC地址。那么企业租用的各个云主机之间可能跨越多个不同的网络,要想将ARP请求转发到目的主机,在传统网络中就必须利用网络隧道技术在两台主机之间所连接的网络中传输消息。因为我们并不清楚云服务提供商所分配给企业的云主机都存放在什么位置,跨越了多少网络。简单来说就是将源主机发出的ARP请求封装在一个特定的数据包中,利用网络隧道协议将此数据包转发到连接目的主机的网络当中去,然后再对数据包进行解封装,最后达到目的主机。这样做的成本比较高,效率比较低,实现起来工作量也是巨大的。因此,随着云服务的发展,传统网络在这方面的劣势就显现出来,而我们通过SDN的方式进行ARP代理则能够很好的解决这个问题。We already know that to communicate between hosts, you must first send an ARP request to obtain the MAC address of the destination host. Then the cloud hosts rented by the enterprise may span multiple different networks. In order to forward the ARP request to the destination host, in the traditional network, the network tunnel technology must be used to transmit messages in the network connected between the two hosts. . Because we don't know where the cloud hosts assigned to enterprises by cloud service providers are stored and how many networks they span. Simply put, it is to encapsulate the ARP request sent by the source host in a specific data packet, use the network tunneling protocol to forward the data packet to the network connected to the destination host, and then decapsulate the data packet, and finally achieve the goal host. The cost of doing so is relatively high, the efficiency is relatively low, and the workload for implementation is also huge. Therefore, with the development of cloud services, the disadvantages of traditional networks in this area are revealed, and our ARP proxy through SDN can solve this problem very well.
众所周知,在SDN架构中,控制器是整个网络中的大脑,网络中所有主机必须与控制器相连接,而控制器则掌握了所有主机的信息。因此,如果在不同网络下的主机间要进行通信,则可以把ARP请求先发送到控制器,因为控制器知道网络内所有主机的信息,则控制器可以直接将目的主机的MAC地址回复给源主机。这样就方便高效的解决两主机之间的通信的问题。As we all know, in the SDN architecture, the controller is the brain of the entire network, all hosts in the network must be connected to the controller, and the controller has the information of all hosts. Therefore, if there is communication between hosts on different networks, the ARP request can be sent to the controller first, because the controller knows the information of all hosts in the network, and the controller can directly reply the MAC address of the destination host to the source host. In this way, the problem of communication between the two hosts can be solved conveniently and efficiently.
DHCPSnooping技术是DHCP安全特性,通过建立和维护DHCPSnooping绑定表过滤不可信任的DHCP信息,这些信息是指来自不信任区域的DHCP信息。DHCPSnooping绑定表包含不信任区域的用户IP地址、MAC地址、租用期、VLAN-ID接口等信息。The DHCPSnooping technology is a security feature of DHCP. It establishes and maintains a DHCPSnooping binding table to filter untrusted DHCP information, which refers to DHCP information from untrusted areas. The DHCPSnooping binding table contains user IP address, MAC address, lease period, VLAN-ID interface and other information in the untrusted area.
当交换机开启了DHCP-Snooping后,会对DHCP报文进行侦听,并可以从接收到的DHCPRequest或DHCPAck报文中提取并记录IP地址和MAC地址信息。另外,DHCP-Snooping允许将某个物理端口设置为信任端口或不信任端口。信任端口可以正常接收并转发DHCPOffer报文,而不信任端口会将接收到的DHCPOffer报文丢弃。这样,可以完成交换机对假冒DHCPServer的屏蔽作用,确保客户端从合法的DHCPServer获取IP地址。When DHCP-Snooping is enabled on the switch, it will listen to DHCP packets, and can extract and record the IP address and MAC address information from the received DHCPRequest or DHCPAck packets. In addition, DHCP-Snooping allows a physical port to be set as a trusted port or an untrusted port. Trusted ports can normally receive and forward DHCPOffer packets, while untrusted ports discard received DHCPOffer packets. In this way, the shielding effect of the switch on the counterfeit DHCPServer can be completed, ensuring that the client obtains an IP address from a legitimate DHCPServer.
DHCPSnooping的作用The role of DHCPSnooping
(1).DHCPSnooping的主要作用就是隔绝非法的DHCPServer,通过配置非信任端口。(1). The main function of DHCPSnooping is to isolate illegal DHCPServers by configuring untrusted ports.
(2).与交换机DAI的配合,防止ARP病毒的传播。(2). Cooperate with the exchange DAI to prevent the spread of ARP virus.
(3).建立和维护一张DHCPSnooping的绑定表,这张表一是通过DHCPAck包中的IP和MAC地址生成的,二是可以手工指定。这张表是后续DAI(dynamicarpinspect)和IPSourceGuard基础。这两种类似的技术,是通过这张表来判定IP或者MAC地址是否合法,来限制用户连接到网络的。(3). Establish and maintain a binding table for DHCPSnooping. This table is firstly generated through the IP and MAC addresses in the DHCPAck packet, and secondly, it can be manually specified. This table is the basis for subsequent DAI (dynamicarpinspect) and IPSourceGuard. These two similar technologies use this table to determine whether the IP or MAC address is legal to restrict users from connecting to the network.
在本方案中,通过对上传到控制器的DHCP数据包进行操作与分析,将需要得到的数据自动提取出来建立一张绑定表,不需要手工添加,IP、MAC、PORT等信息一一对应,绑定关系建立后,从相应的端口收到的数据报文,根据其源地址是否在端口绑定关系表中有匹配来确定报文是否合法,从而对合法报文正常转发,非法报文则丢弃,这大大提升了系统的安全性。In this solution, through the operation and analysis of the DHCP data packets uploaded to the controller, the required data is automatically extracted to create a binding table, no need to manually add, IP, MAC, PORT and other information correspond to each other , after the binding relationship is established, the data message received from the corresponding port will determine whether the message is legal according to whether its source address matches in the port binding relationship table, so that the legal message is forwarded normally, and the illegal message is forwarded normally. It is discarded, which greatly improves the security of the system.
在大型数据中心,有着成千上万的主机,通过利用SDN的优势,将接入到网络中的所有主机信息进行整合,建立和维护一张绑定表,这样不仅获得了所有主机的详细信息,为ARP代理及主机通信提供必要的数据,而且对于日常主机的集中管理有着非常大的帮助。这是传统网络所无法比拟的优势,也是我研究此项工作的意义。In a large data center, there are tens of thousands of hosts. By using the advantages of SDN, the information of all hosts connected to the network is integrated, and a binding table is established and maintained, so that not only the detailed information of all hosts can be obtained , to provide necessary data for ARP agent and host communication, and it is very helpful for the centralized management of daily hosts. This is an advantage that traditional networks cannot match, and it is also the significance of my research on this work.
发明内容Contents of the invention
在SDN环境下的ARP代理在研究意义中已经详细列出,SDN网络本身就是一项十分具有创新意义的技术。我们以SDN为大背景,利用其自身特点开发出一种比传统网络更高效更安全的ARP代理方案。与传统网络相比,我们的ARP代理方案有许多创新之处,详细介绍如下:The ARP proxy in the SDN environment has been listed in detail in the research significance, and the SDN network itself is a very innovative technology. We take SDN as the background and use its own characteristics to develop an ARP proxy solution that is more efficient and safer than traditional networks. Compared with the traditional network, our ARP proxy solution has many innovations, the details are as follows:
控制器在SDN网络环境当中至关重要,我们的方案是在控制器当中创建一张存有主机相关信息的dhcp_lease表,其中包括主机IP地址,主机MAC地址,主机端口号,IP地址获得时间,IP租约时间。然而这些数据我们都能够自动获得,不需要人工干预,并且保证所获得数据的安全性。因此我们的ARP代理方案采用DHCP代理的方法同时获得主机IP地址,主机MAC地址,主机端口号,IP地址获得时间,IP租约时间。我们通过模拟DHCP协议的工作流程自动获取我们想要的数据,并且写入dhcp_lease表中。这也是我们这个方案的另一个创新点。The controller is very important in the SDN network environment. Our solution is to create a dhcp_lease table in the controller that stores information about the host, including the host IP address, host MAC address, host port number, and IP address acquisition time. IP lease time. However, we can obtain these data automatically without manual intervention, and ensure the security of the obtained data. Therefore, our ARP proxy solution uses the DHCP proxy method to obtain the host IP address, host MAC address, host port number, IP address acquisition time, and IP lease time at the same time. We automatically obtain the data we want by simulating the workflow of the DHCP protocol, and write it into the dhcp_lease table. This is another innovation point of our scheme.
其中主机IP地址与主机MAC为对应关系,如果主机IP地址租约到期,则表中此条表项会被删除,主机MAC地址不再与此IP地址对应。The host IP address corresponds to the host MAC address. If the host IP address lease expires, this entry in the table will be deleted, and the host MAC address will no longer correspond to this IP address.
程序启动则自动下发匹配ARP,DHCP数据包的流表,将匹配流表的数据包上传到控制器并同时启动扫描dhcp_lease表中过期主机IP表项的定时器scan_expire。与此同时如果收到主机客户端发出的DHCPDISCOVER或者DHCPREQUEST报文时,提取报文中的event.port即端口号信息写入dhcp_lease表中。收到DHCPACK报文时,提取报文中DHCP服务器分配给该主机的IP地址同该主机的MAC地址,IP获取的时间以及IP的生存周期一起写入dhcp_lease表中。至此,控制器就完成了操作匹配上来的DHCP数据包,将我们所需要的数据自动构建为一张dhcp_lease表,为之后的ARP代理提供必要的数据。When the program starts, it will automatically deliver the flow table matching the ARP and DHCP data packets, upload the data packets matching the flow table to the controller and start the timer scan_expire to scan the expired host IP entry in the dhcp_lease table at the same time. At the same time, if the DHCPDISCOVER or DHCPREQUEST message sent by the host client is received, the event.port in the message is extracted, that is, the port number information is written into the dhcp_lease table. When receiving the DHCPACK message, extract the IP address assigned to the host by the DHCP server in the message, write it into the dhcp_lease table together with the MAC address of the host, the time when the IP was obtained, and the lifetime of the IP. So far, the controller has completed the operation of the matched DHCP data packets, and automatically builds the data we need into a dhcp_lease table to provide necessary data for the subsequent ARP agent.
接下来详细介绍一下我们的ARP代理方案的实现方法。Next, we will introduce the implementation method of our ARP proxy solution in detail.
当主机发出ARPREQUEST时,此时该ARPREQUEST报文将不会转发到目的主机处,而是由控制器提取ARPREQUEST数据包中的目的IP地址,将其与dhcp_lease表中的第一列即主机IP信息进行比较,如果发现匹配项,则按照ARPREPLY的格式构造包含目的MAC地址的ARPREPLY应答包,将其代理回复给发出ARPREQUEST的主机。当发出ARPREQUEST的主机得到目的主机的MAC地址后,继续发送ICMPREQUEST报文,因为根据下发的流表规则,匹配的数据包都会先上传到控制器,所以当控制器收到此ICMPREQUEST报文后,则会提取出该数据包中包含的目的IP地址,继续与dhcp_lease表中的第一列进行比较,发现匹配项,则把相应主机的端口号提取出来封装在Packet_out消息中,将ICMPREQUEST报文通过Packet_out消息转发到目的主机中,目的主机收到此报文后则会回复ICMPREPLY报文。至此,两台主机成功通过控制器代理ARP的方式实现了相互通信。When the host sends an ARPREQUEST, the ARPREQUEST message will not be forwarded to the destination host at this time, but the controller will extract the destination IP address in the ARPREQUEST packet, and compare it with the first column in the dhcp_lease table, which is the host IP information For comparison, if a matching item is found, an ARPREPLY response packet containing the destination MAC address is constructed according to the format of ARPREPLY, and the proxy replies to the host that issued the ARPREQUEST. When the host that sends the ARPREQUEST obtains the MAC address of the destination host, it continues to send the ICMPREQUEST message, because according to the issued flow table rules, the matching data packets will be uploaded to the controller first, so when the controller receives the ICMPREQUEST message , the destination IP address contained in the data packet will be extracted, continue to compare with the first column in the dhcp_lease table, and if a match is found, the port number of the corresponding host will be extracted and encapsulated in the Packet_out message, and the ICMPREQUEST message will be The packet is forwarded to the destination host through the Packet_out message, and the destination host will reply the ICMPREPLY message after receiving the message. So far, the two hosts have successfully communicated with each other through the proxy ARP method of the controller.
在整个程序运行当中,定时器也在不停的运转,每隔一段时间扫描一次dhcp_lease表。scan_expire()顾名思义为扫描过期项。它的功能就是将dhcp_lease表中过期的IP条目信息删除,因为DHCP服务器分配给每个主机的IP地址都是有租约的,租约到期则自动释放掉此IP地址。结合实际情况,如果我们构造的dhcp_lease表中的IP地址过期,即主机MAC不再与IP地址所对应,那么之后的ARP代理过程中将会出现问题。本程序将定时器设定为每30秒扫描一次dhcp_lease表,用当前系统时间减去表中此IP地址的写入时间,差值如果大于表中所定义的生存周期,即表明此IP地址租约到期,被DHCP服务器收回待分配,则将此条IP信息从dhcp_lease表中删除。During the running of the whole program, the timer is also running non-stop, scanning the dhcp_lease table every once in a while. scan_expire(), as the name implies, scans expired items. Its function is to delete the expired IP entry information in the dhcp_lease table, because the IP address assigned to each host by the DHCP server has a lease, and the IP address will be released automatically when the lease expires. Combined with the actual situation, if the IP address in the dhcp_lease table we constructed expires, that is, the host MAC no longer corresponds to the IP address, then there will be problems in the subsequent ARP proxy process. This program sets the timer to scan the dhcp_lease table every 30 seconds, and subtracts the write time of the IP address in the table from the current system time. If the difference is greater than the life cycle defined in the table, it indicates that the IP address is leased When the time expires, the IP information will be deleted from the dhcp_lease table when it is reclaimed by the DHCP server to be allocated.
附图说明Description of drawings
图1是开发实验环境示意图。Figure 1 is a schematic diagram of the development experiment environment.
具体实施方式detailed description
本程序是以POX作为控制器,基于Openflow1.0协议下开发。This program uses POX as the controller and is developed based on the Openflow1.0 protocol.
POX提供了几个基本组件完成常见包的解析,通过下发匹配数据包的流表将数据包上传到控制器,对数据包的操作则在Packet_in事件中完成。处理完之后POX控制器则向Openflow交换机发送Packet_out消息。POX provides several basic components to complete the parsing of common packets. The data packets are uploaded to the controller by sending the flow table matching the data packets, and the operations on the data packets are completed in the Packet_in event. After processing, the POX controller sends a Packet_out message to the Openflow switch.
开发实验环境:Development experiment environment:
控制器:POX控制器Controller: POX controller
Openvswitch版本:2.3.0Openvswitch version: 2.3.0
PC1系统版本:Ubuntu14.04.2LTSPC1 system version: Ubuntu14.04.2LTS
PC2系统版本:Windows7PC2 system version: Windows7
PC3系统版本:Windows7PC3 system version: Windows7
控制器POX及Openvswitch交换机运行在一台装有Ubuntu14.04.2LTS系统版本的PC机上,称为PC1。此PC1配备3个网卡接口。加上两台装有Windows7系统的PC2,PC3组成了本实验的模拟环境。The controller POX and the Openvswitch switch run on a PC with Ubuntu14.04.2LTS system version, called PC1. This PC1 is equipped with 3 network card interfaces. Plus two PC2 and PC3 equipped with Windows7 system constitute the simulation environment of this experiment.
装有控制器POX,OVS的PC机称为控制主机PC1,两台Window7系统的PC称为PC2与PC3,PC2与PC3分别连接在PC1的2个网卡上,通过OVS搭建的桥br0将两台PC连接在一起,PC1的另外一个网卡与DHCP服务器相连,这样,PC2,PC3通过桥接都可以与DHCP服务器通信,获得DHCP服务。The PC equipped with the controller POX and OVS is called the control host PC1, and the two Windows 7 PCs are called PC2 and PC3. PC2 and PC3 are respectively connected to the two network cards of PC1. The bridge br0 built by OVS connects the two The PCs are connected together, and the other network card of PC1 is connected to the DHCP server. In this way, PC2 and PC3 can communicate with the DHCP server through the bridge to obtain the DHCP service.
实验效果:Experimental effect:
本程序用2台PC模拟网络中任意2台不同的主机,它们分别从DHCP服务器获取自己的IP地址与此同时控制器POX也获得了两台PC的相关信息并建立成表。之后PC2可通过利用本方案提出的ARP代理技术与PC3建立通信。This program uses 2 PCs to simulate any 2 different hosts in the network, and they respectively obtain their own IP addresses from the DHCP server. At the same time, the controller POX also obtains the relevant information of the two PCs and creates a table. Afterwards, PC2 can establish communication with PC3 by using the ARP proxy technology proposed in this solution.
本发明在计算机中是依次按以下步骤实现的:The present invention is realized in the following steps successively in computer:
步骤(1):下发匹配ARP,DHCP数据包的流表Step (1): Send the flow table matching ARP and DHCP packets
在PC1上启动程序,下发匹配ARP,DHCP数据包的流表,然后将与流表匹配的数据包上传到控制器POXStart the program on PC1, issue the flow table matching the ARP and DHCP packets, and then upload the data packets matching the flow table to the controller POX
步骤(2):启动定时器扫描过期IP条目Step (2): Start a timer to scan expired IP entries
启动扫描dhcp_lease表中过期主机IP表项的定时器scan_expire,在整个程序运行期间按照程序定义的内容不间断的运行,定时器的设置的功能如下:Start the timer scan_expire that scans the expired host IP entry in the dhcp_lease table, and run continuously according to the content defined by the program during the entire program running. The function of the timer setting is as follows:
步骤(2.1):打印出系统时间便于观察与分析。Step (2.1): Print out the system time for observation and analysis.
步骤(2.2):遍历list_all列表,將过期的IP条目信息删除,將未过期的条目重新写入磁盘文档。Step (2.2): traverse the list_all list, delete the expired IP entry information, and rewrite the non-expired entry to the disk file.
步骤(2.3):把时间格式化,转化为系统能够处理的格式。Step (2.3): format the time and convert it into a format that the system can handle.
步骤(2.4):將IP条目写入的时间与当前的时间换算成秒。Step (2.4): the time when the IP entry is written and the current time are converted into seconds.
步骤(2.5):用当前的时间减去IP条目信息写入到磁盘的时间得出这条信息已经存在的时间。Step (2.5): subtract the time when the IP entry information is written to the disk with the current time to obtain the existing time of this information.
步骤(2.6):如果IP条目信息存在的时间大于规定的租约时间则删除这条信息。Step (2.6): If the time that the IP entry information exists is greater than the specified lease time, then delete this information.
步骤(2.7):定时器每隔30秒钟扫描一次。Step (2.7): The timer scans every 30 seconds.
步骤(3):PC2,PC3获取通过DHCP服务申请IP地址Step (3): PC2 and PC3 obtain and apply for an IP address through the DHCP service
在PC2,PC3上输入ipconfig/renew命令,向DHCP服务器申请IP地址,此命令触发arp_dhcp_handler.py中DHCP模块的相关操作,即把PC2,PC3的相关信息写入dhcp_lease表中。控制器通过对上传的DHCP数据包进行解析,将其主要信息提取出来写入表中,表中内容从头到尾一次为,PC2,PC3获得的IP地址、PC2,PC3的MAC地址、PC2,PC3与PC1连接的端口号、IP获取时间、IP生存周期。Enter the ipconfig/renew command on PC2 and PC3 to apply for an IP address from the DHCP server. This command triggers the relevant operations of the DHCP module in arp_dhcp_handler.py, that is, writes the relevant information of PC2 and PC3 into the dhcp_lease table. The controller analyzes the uploaded DHCP data packet, extracts its main information and writes it into the table. The contents of the table are, from the beginning to the end, the IP addresses obtained by PC2 and PC3, the MAC addresses of PC2 and PC3, and the PC2 and PC3 Port number connected to PC1, IP acquisition time, and IP lifetime.
步骤(4):实现控制器代理ARP功能。Step (4): Realize the controller proxy ARP function.
程序启动时已经下发了匹配DHCP,ARP数据包的流表使其上传到控制器。要想实现网络内的主机PC2与PC3之间的相互通信,首先PC2需发出ARP请求,ARP请求数据包被上传到控制器POX,控制器POX提取PC2发出的ARP请求包中的目的IP地址信息,使其与dhcp_lease表中的第一列即主机IP信息进行匹配,发现与PC3的信息匹配,则将第二列中的PC3的MAC地址代理回复给发出ARP请求的主机PC2。当发出ARP请求的主机PC2学习到目的主机PC3的MAC地址后,则会继续发送ICMPREQUEST报文,当控制器获取到此报文后,则会提取出数据包中包含的目的IP地址,继续与dhcp_lease表中的第一列进行比较,发现匹配项,则把相应主机PC3的OpenFlow端口号提取出来封装在Packet_out消息中,然后转发到目的主机PC3中,之后目的主机PC3发送ICMPREPLY报文至PC2。至此,两台主机满足通信所具备的的条件因此实现相互通信。When the program starts, the flow table of matching DHCP and ARP packets has been issued to upload to the controller. In order to realize the mutual communication between host PC2 and PC3 in the network, first PC2 needs to send an ARP request, and the ARP request data packet is uploaded to the controller POX, and the controller POX extracts the destination IP address information in the ARP request packet sent by PC2 , make it match with the host IP information in the first column in the dhcp_lease table, and find that it matches the information of PC3, then reply the MAC address of PC3 in the second column to the host computer PC2 that sends the ARP request. When the host PC2 that sent the ARP request learns the MAC address of the destination host PC3, it will continue to send the ICMPREQUEST message. When the controller obtains this message, it will extract the destination IP address contained in the data packet and continue to communicate with The first column in the dhcp_lease table is compared, and if a match is found, the OpenFlow port number of the corresponding host PC3 is extracted and encapsulated in a Packet_out message, and then forwarded to the destination host PC3, and then the destination host PC3 sends an ICMPREPLY message to PC2. So far, the two hosts meet the conditions for communication and thus realize mutual communication.
步骤(5):下发匹配目的主机IP,目的主机端口号到流表Step (5): Deliver the matching destination host IP and destination host port number to the flow table
下发匹配目的主机PC3的IP,端口号的流表。使之后类似的数据包直接按流表规则从交换机直接转发,不再上传到控制器。这样既能够保证通信效率也能够减轻控制器的负载,从而保证整个网络正常运转。Send the flow table matching the IP and port number of the destination host PC3. Afterwards, similar data packets are directly forwarded from the switch according to the rules of the flow table, and are no longer uploaded to the controller. This can not only ensure the communication efficiency but also reduce the load of the controller, so as to ensure the normal operation of the entire network.
Claims (1)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610127935.5A CN105812502A (en) | 2016-03-07 | 2016-03-07 | OpenFlow-based implementation method for address resolution protocol proxy technology |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201610127935.5A CN105812502A (en) | 2016-03-07 | 2016-03-07 | OpenFlow-based implementation method for address resolution protocol proxy technology |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN105812502A true CN105812502A (en) | 2016-07-27 |
Family
ID=56467663
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201610127935.5A Pending CN105812502A (en) | 2016-03-07 | 2016-03-07 | OpenFlow-based implementation method for address resolution protocol proxy technology |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN105812502A (en) |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106506534A (en) * | 2016-12-09 | 2017-03-15 | 河南工业大学 | An ARP attack detection method for SDN network |
| CN107911297A (en) * | 2017-11-21 | 2018-04-13 | 迈普通信技术股份有限公司 | A kind of SDN network band control Path Setup method and apparatus |
| CN109842692A (en) * | 2018-11-13 | 2019-06-04 | 联想企业解决方案(新加坡)有限公司 | VxLAN switch, system and method for obtaining host information in physical network |
| CN110401733A (en) * | 2019-08-22 | 2019-11-01 | 中国科学院声学研究所 | Method, system and controller for implementing ARP protocol in SDN network |
| CN111010362A (en) * | 2019-03-20 | 2020-04-14 | 新华三技术有限公司 | Method and device for monitoring abnormal host |
| CN111431912A (en) * | 2020-03-30 | 2020-07-17 | 上海连尚网络科技有限公司 | Method and device for detecting DHCP hijacking |
| CN111884916A (en) * | 2020-07-24 | 2020-11-03 | 杭州希益丰新业科技有限公司 | Proxy gateway system for realizing transparent transmission based on multi-network-port computer |
| CN112235881A (en) * | 2020-10-21 | 2021-01-15 | 深圳市友华软件科技有限公司 | Method and device for truly displaying down-hanging equipment based on ONU (optical network Unit) relay network |
| US20210377299A1 (en) * | 2020-05-26 | 2021-12-02 | Dell Products L.P. | Determine a trusted dynamic host configuration protocol (dhcp) server in a dhcp snooping environment |
Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0915594A2 (en) * | 1997-10-07 | 1999-05-12 | AT&T Corp. | Method for route selection from a central site |
| CN101442436A (en) * | 2007-11-20 | 2009-05-27 | 国际商业机器公司 | IP network management method and system |
| CN103248724A (en) * | 2013-04-19 | 2013-08-14 | 中国(南京)未来网络产业创新中心 | SDN (Software-Defined Networking) controller-based DHCP (Dynamic Host Configuration Protocol) broadcast processing method |
| CN103650427A (en) * | 2011-07-08 | 2014-03-19 | 阿尔卡特朗讯公司 | Centralized system for routing ethernet packets over an internet protocol network |
| CN104202266A (en) * | 2014-08-04 | 2014-12-10 | 福建星网锐捷网络有限公司 | Communication method, switch, controller and communication system |
| CN104301238A (en) * | 2014-10-17 | 2015-01-21 | 福建星网锐捷网络有限公司 | Message processing method, device and system |
-
2016
- 2016-03-07 CN CN201610127935.5A patent/CN105812502A/en active Pending
Patent Citations (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP0915594A2 (en) * | 1997-10-07 | 1999-05-12 | AT&T Corp. | Method for route selection from a central site |
| CN101442436A (en) * | 2007-11-20 | 2009-05-27 | 国际商业机器公司 | IP network management method and system |
| CN103650427A (en) * | 2011-07-08 | 2014-03-19 | 阿尔卡特朗讯公司 | Centralized system for routing ethernet packets over an internet protocol network |
| CN103248724A (en) * | 2013-04-19 | 2013-08-14 | 中国(南京)未来网络产业创新中心 | SDN (Software-Defined Networking) controller-based DHCP (Dynamic Host Configuration Protocol) broadcast processing method |
| CN104202266A (en) * | 2014-08-04 | 2014-12-10 | 福建星网锐捷网络有限公司 | Communication method, switch, controller and communication system |
| CN104301238A (en) * | 2014-10-17 | 2015-01-21 | 福建星网锐捷网络有限公司 | Message processing method, device and system |
Cited By (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106506534B (en) * | 2016-12-09 | 2019-09-27 | 河南工业大学 | An ARP attack detection method for SDN network |
| CN106506534A (en) * | 2016-12-09 | 2017-03-15 | 河南工业大学 | An ARP attack detection method for SDN network |
| CN107911297B (en) * | 2017-11-21 | 2020-03-24 | 迈普通信技术股份有限公司 | SDN network in-band control channel establishment method and device |
| CN107911297A (en) * | 2017-11-21 | 2018-04-13 | 迈普通信技术股份有限公司 | A kind of SDN network band control Path Setup method and apparatus |
| CN109842692A (en) * | 2018-11-13 | 2019-06-04 | 联想企业解决方案(新加坡)有限公司 | VxLAN switch, system and method for obtaining host information in physical network |
| CN111010362A (en) * | 2019-03-20 | 2020-04-14 | 新华三技术有限公司 | Method and device for monitoring abnormal host |
| CN111010362B (en) * | 2019-03-20 | 2021-09-21 | 新华三技术有限公司 | Monitoring method and device for abnormal host |
| US12160431B2 (en) | 2019-03-20 | 2024-12-03 | New H3C Technologies Co., Ltd. | Monitoring of abnormal host |
| CN110401733A (en) * | 2019-08-22 | 2019-11-01 | 中国科学院声学研究所 | Method, system and controller for implementing ARP protocol in SDN network |
| CN111431912A (en) * | 2020-03-30 | 2020-07-17 | 上海连尚网络科技有限公司 | Method and device for detecting DHCP hijacking |
| CN111431912B (en) * | 2020-03-30 | 2021-12-28 | 上海尚往网络科技有限公司 | Method and device for detecting DHCP hijacking |
| US20210377299A1 (en) * | 2020-05-26 | 2021-12-02 | Dell Products L.P. | Determine a trusted dynamic host configuration protocol (dhcp) server in a dhcp snooping environment |
| US11641374B2 (en) * | 2020-05-26 | 2023-05-02 | Dell Products L.P. | Determine a trusted dynamic host configuration protocol (DHCP) server in a DHCP snooping environment |
| CN111884916A (en) * | 2020-07-24 | 2020-11-03 | 杭州希益丰新业科技有限公司 | Proxy gateway system for realizing transparent transmission based on multi-network-port computer |
| CN112235881A (en) * | 2020-10-21 | 2021-01-15 | 深圳市友华软件科技有限公司 | Method and device for truly displaying down-hanging equipment based on ONU (optical network Unit) relay network |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN105812502A (en) | OpenFlow-based implementation method for address resolution protocol proxy technology | |
| CN114070723B (en) | Virtual network configuration method and system of bare metal server and intelligent network card | |
| US12301479B2 (en) | Managing network traffic in virtual switches based on logical port identifiers | |
| US12273415B2 (en) | Mirroring network traffic of virtual networks at a service provider network | |
| EP3261300B1 (en) | Method and device for establishing link between virtual network functions | |
| CN112468383B (en) | Communication method and gateway, management method and device in hybrid cloud environment | |
| US11374899B2 (en) | Managing network connectivity between cloud computing service endpoints and virtual machines | |
| CN111385173B (en) | Message processing method and device, control plane equipment and computer storage medium | |
| CN103580980B (en) | Method and device for automatic discovery and automatic configuration of virtual network | |
| WO2023098645A1 (en) | Container network configuration method and apparatus, computing node, master node, and storage medium | |
| CN104135446B (en) | System and methods of the IPv4 to IPv6 transition is realized based on SDN | |
| CN107733670A (en) | A kind of forwarding strategy collocation method and device | |
| CN106412142A (en) | Resource device address obtaining method and device | |
| WO2013170652A1 (en) | Overlay tunnel information exchange protocol | |
| CN104322022B (en) | Multi-tenant system, interchanger, controller and block transmission method | |
| WO2018006704A1 (en) | Public network ip allocation method and apparatus, and virtual data center system | |
| US8887237B2 (en) | Multimode authentication | |
| CN105071945A (en) | Network terminal address bulk binding method based on interchanger technology | |
| CN102780602B (en) | Method and device for data transmission | |
| CN107181812A (en) | One kind accelerates agent equipment, accelerates Proxy Method and a kind of Content Management System | |
| US20180139150A1 (en) | Dynamic endpoint group binding for cross-tenant resource sharing in software defined networks | |
| CN108833472B (en) | System is established in the connection of cloud host | |
| CN103684858B (en) | A kind of method that tenant network generation and label packet are handled, and relevant device | |
| CN115865865A (en) | A cloud-native dual-stack communication method and system based on macvlan | |
| CN105897949A (en) | Method and system for directly accessing data center internal network |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| RJ01 | Rejection of invention patent application after publication |
Application publication date: 20160727 |
|
| RJ01 | Rejection of invention patent application after publication |