CN114095508A - Method for P2P transmission under same switch - Google Patents

Method for P2P transmission under same switch Download PDF

Info

Publication number
CN114095508A
CN114095508A CN202010756590.6A CN202010756590A CN114095508A CN 114095508 A CN114095508 A CN 114095508A CN 202010756590 A CN202010756590 A CN 202010756590A CN 114095508 A CN114095508 A CN 114095508A
Authority
CN
China
Prior art keywords
client
switch
server
file
clients
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
Application number
CN202010756590.6A
Other languages
Chinese (zh)
Inventor
于维纳
夏青元
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nanjing University of Science and Technology
Original Assignee
Nanjing University of Science and Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Nanjing University of Science and Technology filed Critical Nanjing University of Science and Technology
Priority to CN202010756590.6A priority Critical patent/CN114095508A/en
Publication of CN114095508A publication Critical patent/CN114095508A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1074Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
    • H04L67/1078Resource delivery mechanisms
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The invention discloses a method for transmitting P2P under the same switch. The method comprises the following steps: the link establishing part is used for actively reporting relevant information of the switch to the client by using an LLDP protocol after a first client accesses the switch in a local area network, reporting the switch information and file transmission information to a server by the client, and sending download data request information to the server by the first client; the server responds a second client with the file in the same local area network and priority under the same switch to the first client for downloading; and the downloading part is used for establishing a data link between the first client and the second client, the first client sends a data downloading request to the second client, and the first client starts to download the file from the second client. The invention realizes that the data transmission is carried out under the same exchanger, and has the advantages of simplicity, convenience and high efficiency.

Description

Method for P2P transmission under same switch
Technical Field
The invention relates to the technical field of network transmission, in particular to a method for P2P transmission under a switch.
Background
With the rapid development of the information age, the local area network transmission is a universal demand, and in the early stage of the network rise, the local area network transmission receives general attention, and various large network manufacturers propose solutions thereof.
(1) Client/Server (C/S) based mode
The C/S mode is a software system architecture, can fully utilize the advantage of the hardware environment through the C/S mode, distribute the task to Client end and Server end to realize rationally, have reduced the communication overhead of the system. At present, most application software systems are of a two-layer structure in a C/S form, the server is a computer which runs corresponding application software in a network environment and provides shared information resources and various services for network users, a high-performance personal computer, a workstation or a small computer is generally adopted, a large-scale database system can be adopted, and a client correspondingly needs to install special client software.
The C/S mode has the following disadvantages: the speed of downloading files is generally changed in real time according to the network conditions, although the client and the server may be in a local area network, especially when many clients download large files simultaneously, the downloading speed of the client is greatly limited, so that the downloading speed of many clients is extremely slow, further, if the server does not have the files required by the client, the client cannot download the files any more, the server needs to be guaranteed to run in twenty-four hours to provide the files for the required clients to download, and the running mode causes a large load to the server, so that the performance of the server is poor. Moreover, network management staff need to maintain and manage the server and the client, and the required maintenance cost is high.
(2) Proxy server model based on same LAN
A first client sends a request parameter for downloading a file to a first proxy server, wherein the request parameter comprises information of the file to be downloaded; according to the request parameters, the first proxy server sends broadcast messages and User Datagram Protocol (UDP) messages to other clients in a local area network where the first client is located, wherein the UDP messages comprise the request parameters; after receiving a feedback message of a second client in the local area network, the first proxy server forwards the request parameter to a second proxy server of the second client; the second proxy server searches a corresponding storage file according to the request parameter and returns the storage file to the first proxy server; and the first client saves the storage file.
Although the method solves the problem of slow downloading speed in the process of downloading the file from the server, the load of the server can be reduced, and the performance of the server is improved, when batch terminals download the file from the same terminal at the same time, the downloading method has high requirements on network bandwidth, the downloading speed of each terminal is not delayed, and the first proxy server needs to send broadcast messages to other clients in the same local area network, which easily causes broadcast storm. In addition, there are multiple proxy servers, which are costly to maintain.
Peer-to-peer (P2P) is also called peer-to-peer technology, and is a new technology of network, relying on the computing power and bandwidth of participants in the network, rather than aggregating the dependencies on a few servers. The existing P2P technology under the same switch at present does not exist for a while, and there are other forms, such as a point-to-point download system, which changes the remote download into the local area network download, and does not generate a loop when multicast is performed in a plurality of switches. However, there are still disadvantages that transmission under multiple switches has high requirements for network bandwidth support and affects the network of other terminals in the lan.
Disclosure of Invention
The invention aims to provide a simple, convenient and efficient P2P transmission method under a switch, which realizes that data transmission is carried out under the same switch.
The technical solution for realizing the purpose of the invention is as follows: a method for transmitting P2P under the same switch comprises three parts of link building, selecting and downloading, wherein:
the link establishing part comprises a data link creating stage and a data requesting stage: in the local area network, after a first client accesses a switch, the switch actively reports switch information to the first client by using an LLDP protocol; the first client reports the switch information and the file transmission information to the server, and sends data downloading request information to the server;
the selection part comprises a data interaction stage and an optimal second client retrieval stage: the server receives the request information of downloading data of the first client and stores the request information; the server side searches all the clients of the same switch under the same local area network, wherein the clients do not include a first client, and searches whether the file requested by the first client exists in all the clients, if one of the clients has the file requested by the first client and no other client establishes a link with the client, the client is used as second client information to be returned to the first client for downloading the requested file;
and the downloading part comprises a step of establishing a data link between the first client and the second client, wherein the first client sends a data downloading request to the second client, and the first client starts to download the file from the second client.
Further, the creation phase of the data link of the link establishment part specifically includes the following steps:
the LLDP function of the switch is enabled, then the first client reports the switch information actively reported by the switch to the server, and the server performs overall processing, specifically as follows:
1) the first client and the server are started to establish a link;
2) each first client sends switch information comprising a switch name, a switch MAC and a switch speed to the server at regular time;
3) and the server writes the MAC of the first client into the database according to the name of the switch, the MAC of the switch and the speed information of the switch, so that the first client establishes a corresponding relation with the access switch.
Further, a data interaction phase of a selected part is specifically as follows:
1) a user requests a file on a first client interface, and the first client sends UUID information in file information, namely unique identification information of the file to a server;
2) after receiving the unique identification information of the file sent by the first client, the server firstly retrieves the switch accessed by the first client according to the MAC information of the first client;
3) the server retrieves all the clients accessed under the switch according to the switch accessed by the first client, wherein the clients do not comprise the first client;
4) the server side searches whether a request file of the first client side exists in all client sides of the switch accessed by the first client side, except the first client side, according to the received unique identification information of the file of the first client side;
5) if the server searches that a file which is consistent with the unique identification information of the file requested by the first client exists in one client of the switch accessed by the first client, the server returns the MAC information of the client as a second client to the first client, and the second client is determined at the moment;
6) after receiving the MAC address of the second client responded by the server, the first client actively establishes a link with the second client;
7) after a link is established between a first client and a second client, unique identification information of a file is sent to the second client;
8) the second client receives the request of the first client, retrieves the target file according to the unique identification information of the file, and returns the content of the target file to the first client;
if a plurality of clients simultaneously download the same file, when the server selects a second client, all the clients of the same switch under the same local area network are searched, except the first client, whether the file requested by the first client exists or not is searched from all the clients, if one of the clients has the file requested by the first client and no other client establishes a link with the client, the client is used as the second client to download the requested file.
Further, in the retrieval phase of selecting part of optimal second clients, the method for the server to select the second clients is as follows:
1) after receiving the unique identification information of the file sent by the first client, the server firstly retrieves the switch accessed by the first client according to the MAC information of the first client;
2) the server retrieves all the clients accessed under the switch according to the switch accessed by the first client, wherein the clients do not comprise the first client;
3) the server side traverses all the clients, does not include the first client, and judges whether the unique identification information of the file sent by the first client exists in one client, namely whether the file requested by the first client exists in one client;
4) if a certain client searches for a file which is not requested by the first client, the client cannot serve as a second client, and then the step is turned to 3), and the rest clients which are not traversed are continuously judged;
5) if a certain client retrieves the file requested by the first client, judging whether the client is provided for other clients for downloading or not, wherein the client does not comprise the first client, namely whether other clients establish a link from the client for downloading or not;
5) if a certain client finds that no other client establishes link downloading with the client, the server returns the MAC information of the client as a second client to the first client at the moment, the second client is confirmed at the moment, and the process is ended;
6) if a certain client finds that other clients establish link downloading with the client, whether the downloading number of the client exceeds the system configuration is judged, namely whether the maximum value of the downloading provided by the certain client for the other clients exceeds the system configuration is judged;
7) if the maximum value provided by a certain client for other clients to download exceeds the system configuration and the client cannot serve as a second client, turning to 3), and continuing to judge the rest clients which are not traversed;
8) if the maximum value provided by a certain client for other clients to download does not exceed the system configuration, the server stores the minimum values downloaded by all the clients as optimal values;
9) judging whether the server completes traversal of all the clients, if not, turning to 3), and continuing to judge the rest clients which are not traversed;
10) and if the server finishes traversing all the clients, the server returns the client information with the optimal value to the first client to be used as the second client, and the process is ended.
Compared with the prior art, the invention has the following remarkable advantages: (1) the characteristics of the switch are fully utilized, so that transmission does not cross the switch, and no additional hardware support is needed; (2) the property of the switch in the local area network is utilized, so that point-to-point transmission of the same local area network is simple, convenient and efficient, and the accuracy can be ensured under the condition of convenient operation; (3) the method not only can realize point-to-point high-efficiency transmission in the same local area network, but also can realize the transmission by software without transforming the existing network, thereby reducing the cost and having simple and easy operation; (4) for the installation and use of the user, other related skills do not need to be mastered, the user experience improvement effect is obvious, and beneficial economic benefits and social benefits can be generated.
Drawings
Fig. 1 is a flow chart of terminal timing reporting.
Fig. 2 is a transmission flow chart of the network P2P.
Fig. 3 is a second client selection flow diagram.
Detailed Description
The method for transmitting P2P under the same local area network utilizes the property of the switch in the local area network to ensure that the point-to-point transmission of the same local area network becomes simple, convenient and efficient. Similarly, under the condition of convenient operation, the accuracy of the method can be ensured, which is also important in the invention. In order to balance load, when a plurality of clients simultaneously request the same file, the server searches other clients with the file in the same switch, and preferentially selects the client without the download request to download, rather than downloading from only one terminal. When the download request of each client reaches the maximum value or other clients under the same switch do not have the file, the server selects to download from the server.
With reference to fig. 1 to 3, the method for transmitting P2P under the same switch of the present invention includes three parts, namely, link establishment, selection and downloading, wherein:
the link establishing part comprises a data link creating stage and a data requesting stage: in the local area network, after a first client accesses a switch, the switch actively reports switch information to the first client by using an LLDP protocol; the first client reports the switch information and the file transmission information to the server, and sends data downloading request information to the server;
the selection part comprises a data interaction stage and an optimal second client retrieval stage: the server receives the request information of downloading data of the first client and stores the request information; the server side searches all the clients of the same switch under the same local area network, wherein the clients do not include a first client, and searches whether the file requested by the first client exists in all the clients, if one of the clients has the file requested by the first client and no other client establishes a link with the client, the client is used as second client information to be returned to the first client for downloading the requested file;
and the downloading part comprises a step of establishing a data link between the first client and the second client, wherein the first client sends a data downloading request to the second client, and the first client starts to download the file from the second client.
Further, the creation phase of the data link of the link establishment part specifically includes the following steps:
the LLDP function of the switch is enabled, then the first client reports the switch information actively reported by the switch to the server, and the server performs overall processing, specifically as follows:
1) the first client and the server are started to establish a link;
2) each first client sends switch information comprising a switch name, a switch MAC and a switch speed to the server at regular time;
3) and the server writes the MAC of the first client into the database according to the name of the switch, the MAC of the switch and the speed information of the switch, so that the first client establishes a corresponding relation with the access switch.
Further, a data interaction phase of a selected part is specifically as follows:
1) a user requests a file on a first client interface, and the first client sends UUID information in file information, namely unique identification information of the file to a server;
2) after receiving the unique identification information of the file sent by the first client, the server firstly retrieves the switch accessed by the first client according to the MAC information of the first client;
3) the server retrieves all the clients accessed under the switch according to the switch accessed by the first client, wherein the clients do not comprise the first client;
4) the server side searches whether a request file of the first client side exists in all client sides of the switch accessed by the first client side, except the first client side, according to the received unique identification information of the file of the first client side;
5) if the server searches that a file which is consistent with the unique identification information of the file requested by the first client exists in one client of the switch accessed by the first client, the server returns the MAC information of the client as a second client to the first client, and the second client is determined at the moment;
6) after receiving the MAC address of the second client responded by the server, the first client actively establishes a link with the second client;
7) after a link is established between a first client and a second client, unique identification information of a file is sent to the second client;
8) the second client receives the request of the first client, retrieves the target file according to the unique identification information of the file, and returns the content of the target file to the first client;
if a plurality of clients simultaneously download the same file, when the server selects a second client, all the clients of the same switch under the same local area network are searched, except the first client, whether the file requested by the first client exists or not is searched from all the clients, if one of the clients has the file requested by the first client and no other client establishes a link with the client, the client is used as the second client to download the requested file.
Further, in the retrieval phase of selecting part of optimal second clients, the method for the server to select the second clients is as follows:
1) after receiving the unique identification information of the file sent by the first client, the server firstly retrieves the switch accessed by the first client according to the MAC information of the first client;
2) the server retrieves all the clients accessed under the switch according to the switch accessed by the first client, wherein the clients do not comprise the first client;
3) the server side traverses all the clients, does not include the first client, and judges whether the unique identification information of the file sent by the first client exists in one client, namely whether the file requested by the first client exists in one client;
4) if a certain client searches for a file which is not requested by the first client, the client cannot serve as a second client, and then the step is turned to 3), and the rest clients which are not traversed are continuously judged;
5) if a certain client retrieves the file requested by the first client, judging whether the client is provided for other clients for downloading or not, wherein the client does not comprise the first client, namely whether other clients establish a link from the client for downloading or not;
5) if a certain client finds that no other client establishes link downloading with the client, the server returns the MAC information of the client as a second client to the first client at the moment, the second client is confirmed at the moment, and the process is ended;
6) if a certain client finds that other clients establish link downloading with the client, whether the downloading number of the client exceeds the system configuration is judged, namely whether the maximum value of the downloading provided by the certain client for the other clients exceeds the system configuration is judged;
7) if the maximum value provided by a certain client for other clients to download exceeds the system configuration and the client cannot serve as a second client, turning to 3), and continuing to judge the rest clients which are not traversed;
8) if the maximum value provided by a certain client for other clients to download does not exceed the system configuration, the server stores the minimum values downloaded by all the clients as optimal values;
9) judging whether the server completes traversal of all the clients, if not, turning to 3), and continuing to judge the rest clients which are not traversed;
10) and if the server finishes traversing all the clients, the server returns the client information with the optimal value to the first client to be used as the second client, and the process is ended.
The present invention will be described in further detail below in various aspects.
1 Key Point and Point to be protected
1) The key points are as follows: based on the existing terminal, the P2P high-efficiency transmission function under the same switch is realized by using the switch under the condition of not increasing other hardware and reforming the existing network.
2) Points to be protected: the transmission efficiency is improved by using the characteristics of the switch.
2 alternative scheme
Because the local area network transmission efficiency is improved by using the switch in the scheme, the alternative scheme may be to improve the network transmission efficiency by using the characteristics of other hardware in the local area network, and the method and the device belong to the protection scope of the patent.
3 interpretation of related technical terms
1) Switch
A Switch means a "Switch" is a network device used for electrical (optical) signal forwarding. It may provide an exclusive electrical signal path for any two network nodes accessing the switch. The most common switch is an ethernet switch. Other common are telephone voice switches, fiber switches, and the like.
The switch operates at the second layer of the OSI reference model, the data link layer. The MAC address information in the data packet can be identified, the forwarding is carried out according to the MAC address, and the MAC addresses and the corresponding ports are recorded in an address table in the data packet.
2) LLDP protocol
The Link Layer Discovery Protocol (LLDP) is a vendor-independent two-layer protocol that allows network devices to advertise their device identities and capabilities in the local subnet.
At present, the variety of network devices is increasingly diversified and their respective configurations are complicated, and a standard information exchange platform is required in order to enable devices of different manufacturers to discover and interact their respective systems and configuration information in a network. LLDP (Link Layer Discovery Protocol) is generated under such a background, and provides a standard Link Layer Discovery manner, which can organize Information such as main capability, Management address, device identifier, interface identifier, etc. of a local device into different TLVs (Type/Length/Value), encapsulate the TLVs into LLDPDU (Link Layer Discovery Protocol Data Unit) and distribute the Information to neighbors directly connected to the neighbor, and store the Information in a form of standard MIB (Management Information Base ) after the neighbor receives the Information, so as to allow a network Management system to query and determine a communication status of a Link.
In brief, LLDP is a proximity discovery protocol. It defines a standard method for ethernet network devices, such as switches, routers and wlan access points, to advertise their presence to other nodes in the network and to maintain discovery information for each neighboring device. Detailed information such as device configuration and device identification may be advertised using the protocol.
In particular, LLDP defines a general advertisement information set, a protocol for transmitting advertisements and a method for storing received advertisement information. The device to advertise itself can transmit multiple pieces of advertisement information in a local area network packet, where the transmission is in the form of Type Length Value (TLV) field. The device will periodically send LLDP messages to the neighbor devices. And if the local configuration of the equipment is changed, immediately sending an LLDP message to inform the neighbor equipment of the change condition of the local information as soon as possible. However, in order to prevent a large amount of LLDP messages from being transmitted due to frequent changes of local information, it is necessary to delay a period of time after each LLDP message is transmitted, and then continue to transmit the next message.
3) Transmission speed of exchanger
The transmission speed of the switch refers to the data switching speed of the switch. At present, 10Mbps, 100Mbps.1000Mbps and the like are common.
4) Switch MAC
The MAC address of the layer two switch itself is optional. The two-layer switch can be divided into two types of network management and non-network management, and for the switch with network management, the parameter configuration can be carried out; and the 'non-network-manageable' switch cannot be configured. Because the layer two switch is only used for forwarding data frames and does not unpack and pack the frames, the MAC address of the layer two switch is useless for forwarding data. However, sometimes the switch needs to be configured and managed, that is, the switch needs to communicate with the switch, and at this time, the switch needs a MAC address, and accordingly, the switch at this time is equivalent to a host function of normal communication.
5)UUID
UUID means a universal Unique Identifier (Universally Unique Identifier), which is a standard for Software construction and is also part of the Distributed Computing Environment (DCE) field that is applied by the Open Software Foundation (OSF) organization.
The purpose of the UUID is to allow all elements in the distributed system to have unique identification information without requiring the central control end to specify the identification information. In this way, everyone can establish a UUID that does not conflict with others.
6) Client terminal
The first client-side points to the client-side which requests to download the file from the server.
And the second client side refers to the client side which is returned to the first client side by the server and used for downloading the request file by the first client side.
The other clients refer to all clients which have been registered in the server by the server when the second client is not determined, and do not include the first client.
A client refers to one of the other clients.
4 technical problem to be solved
The technical problem to be solved is as follows: the client can obtain the information of different switches and report the information to the server, so that the server can know the condition of the client accessed by the switch, and the downloaded client information can be distributed to the requesting client.
5 technical scheme
The method for utilizing the switch network P2P in the scheme specifically comprises the following steps:
5.1) preconditions
1) The preconditions for utilizing the switch network P2P are as follows, and the network P2P functions implemented by all the technologies at present need to have the following conditions:
the LLDP function of the switch is already enabled, and is by default in the enabled state.
② if the switch is in the disable state, the switch can be enabled by the command (lldp enable).
And if the switch is in the enabling state, enabling the switch to have the disabling state through a command (undoo Ildp enable). Of course, this is not a prerequisite for the P2P function in this same switch.
2) The LLDP function has two switches, one is a global switch and one is a switch under the interface, and the relationship between the two switches is:
after the global LLDP function is enabled, the LLDP functions of all interfaces are in an enabled state by default.
② after the global LLDP function is enabled, all the configuration about LLDP except the LLDP alarm function restores the default value. So after the global LLDP function is disabled, the LLDP function of the interface is in a disabled state.
③ when only the global and interface LLDP functions are enabled, the interface ロオ will send or receive LLDP messages.
And fourthly, under the condition that the global LLDP function is not enabled, the LLDP commands enabling and disabling the interface are invalid.
When part of interfaces need to enable the LLDP function and the other part needs to disable the LLDP function, the LLDP function can be enabled globally, and the undo LLDP enable command is executed under the interface view that needs to disable the LLDP function. And when the interface with the LLDP function disabled needs to enable the LLDP function again, executing an LLDP enable command to enable the interface LLDP function again under the interface view with the LLDP function needing to be enabled again.
Sixth, the interface enable/disable LLDP command can only be used in the interface view after the LLDP has been globally enabled, but not in the view of the logical port such as vlantif, Eth-Trunk, etc.
And (c) aiming at the Eth-Trunk interface, the LLDP function can be configured only on the member interfaces of the Eth-Trunk, and the LLDP enabling conditions of all the member interfaces have no influence on each other.
After the interface enables the LLDP function, the interface interacts with the neighbor node which enables the LLDP function to make the local terminal interface receive the state information from the neighbor device and transmit the state information of the local terminal device to the neighbor device.
5.2) information reporting
The LLDP function of the switch is enabled, and the next task is that the client reports the relevant information reported by the switch, such as the name of the switch, the MAC of the switch, and the speed of the switch, to the server, and the server performs overall planning processing. The information of the switch accessed by the client is reported at regular time, so that the server can know whether the switch accessed by the client changes or not in time.
1) The client and the server are started to normally establish the link.
2) Each client sends the name of the switch, the MAC of the switch and the speed information of the switch to the server at regular time.
3) The server writes the MAC and the name of the switch, the MAC of the switch and the speed information of the switch into the database according to the reported MAC and name information of the switch of the client, and the server establishes a corresponding relation between the client and the access switch.
5.3) transport with switch P2P
The LLDP function of the switch is enabled, the client can report the accessed switch information to the server, and then can start the P2P transmission function with the switch.
1) A user requests a certain file on a client interface, and the client sends file information such as UUID information, namely unique identification to a server.
2) After the server receives the unique identification information of the file sent by the first client, the switch accessed by the first client is retrieved according to the MAC information of the first client.
3) And the server retrieves all the accessed clients under the switch according to the accessed switch, not including the first client.
4) The server retrieves whether the file exists at other clients of the accessed switch according to the received unique identification information of the file of the first client.
5) And if the server searches that a file which is consistent with the unique identifier of the file requested by the first client exists in the second client of the switch accessed by the first client, the server returns the MAC of the second client to the first client.
6) And after receiving the MAC address of the second client responded by the server, the first client actively establishes a link with the second client.
7) And after the first client establishes a link with the second client, sending the unique file identification to the second client.
8) And the second client receives the request of the first client, retrieves the target file according to the unique identifier and returns the content of the target file to the first client.
9) To this end, the efficiency of implementing the transmission of the network P2P under the same switch in a certain local area network is realized.
Description of the drawings: if a plurality of clients simultaneously download a certain file, the server preferentially selects a client which has the file and does not have the download as a second terminal for downloading when selecting the second client in order to achieve load balance.
The scheme mainly realizes the point-to-point efficient transmission function by utilizing the characteristics of the switch in the local area network, and the specific implementation scheme is as follows.
6 description of hardware parts
In the scheme, the only related hardware is a computer terminal, a server and a switch, and other transformation is avoided. But here the local area network point-to-point transmission needs to be supported by the LLDP protocol of the switch. Almost all brands of switches currently support the LLDP protocol and the switch is open by default.
1) Switch enable and disable operations:
phi if the switch is in a disabled state, the switch can be enabled by a command (lldp enable).
If the switch is in the enabling state, the switch can be enabled through a command (undo lldp enable). Of course, this is not a prerequisite for the P2P function in this same switch.
2) The LLDP function has two switches, one is a global switch and one is a switch under the interface, and the relationship between the two switches is:
after the global LLDP function is enabled, the LLDP functions of all interfaces are in an enabled state by default.
② after the global LLDP function is enabled, all the configuration about LLDP except the LLDP alarm function restores the default value. So after the global LLDP function is disabled, the LLDP function of the interface is in a disabled state.
③ when only the global and interface LLDP functions are enabled, the interface ロオ will send or receive LLDP messages.
And fourthly, under the condition that the global LLDP function is not enabled, the LLDP commands enabling and disabling the interface are invalid.
When part of interfaces need to enable the LLDP function and the other part needs to disable the LLDP function, the LLDP function can be enabled globally, and the undo LLDP enable command is executed under the interface view that needs to disable the LLDP function. And when the interface with the LLDP function disabled needs to enable the LLDP function again, executing an LLDP enable command to enable the interface LLDP function again under the interface view with the LLDP function needing to be enabled again.
The interface enable/disable LLDP command can only be used in the interface view after the LLDP has been globally enabled, and cannot be used in the view of the logical port such as vlani, Eth-Trunk, etc.
Aiming at the Eth-Trunk interface, the LLDP function can only be configured on the member interfaces of the Eth-Trunk, and the LLDP enabling conditions of all the member interfaces have no influence on each other.
After the interface enables the LLDP function, the interface interacts with the neighbor node which enables the LLDP function to make the local terminal interface receive the state information from the neighbor device and transmit the state information of the local terminal device to the neighbor device.
7 description of software part
Efficient point-to-point transmission can be realized in the local area network, and the main principle is to enable the transmitted client to transmit under the same switch instead of across switches.
7.1) information reporting
The LLDP function of the switch is enabled, and the next task is that the client reports the relevant information reported by the switch, such as the name of the switch, the MAC of the switch, and the speed of the switch, to the server, and the server performs overall planning processing. The information of the switch accessed by the client is reported at regular time, so that the server can know whether the switch accessed by the client changes or not in time.
1) The client and the server are started to normally establish the link.
2) Each client sends the name of the switch, the MAC of the switch and the speed information of the switch to the server at regular time.
3) The server writes the MAC and the name of the switch, the MAC of the switch and the speed information of the switch into the database according to the reported MAC and name information of the switch of the client, and the server establishes a corresponding relation between the client and the access switch.
7.2) transport with switch P2P
The LLDP function of the switch is enabled, the client can report the accessed switch information to the server, and then can start the P2P transmission function with the switch.
1) A user requests a certain file on a client interface, and the client sends file information such as UUID information, namely unique identification to a server.
2) After the server receives the unique identification information of the file sent by the first client, the switch accessed by the first client is retrieved according to the MAC information of the first client.
3) And the server retrieves all the accessed clients under the switch according to the accessed switch, not including the first client.
4) The server retrieves whether the file exists at other clients of the accessed switch according to the received unique identification information of the file of the first client.
5) And if the server searches that a file which is consistent with the unique identifier of the file requested by the first client exists in the second client of the switch accessed by the first client, the server returns the MAC of the second client to the first client.
6) And after receiving the MAC address of the second client responded by the server, the first client actively establishes a link with the second client.
7) And after the first client establishes a link with the second client, sending the unique file identification to the second client.
8) And the second client receives the request of the first client, retrieves the target file according to the unique identifier and returns the content of the target file to the first client.
9) To this end, the efficiency of implementing the transmission of the network P2P under the same switch in a certain local area network is realized.
The server selects a second client
The method for the server to select the second client comprises the following steps:
1) after the server receives the unique identification information of the file sent by the first client, the switch accessed by the first client is retrieved according to the MAC information of the first client.
2) The server retrieves all the accessed clients under the switch, excluding the first client, such as the second client, the third client, … … and the nth client, according to the accessed switch.
3) The server judges whether the second client has the unique identification information of the file sent by the first client, namely whether the second client has the file requested by the first client.
4) The second client retrieves the file requested by the first client, and judges whether the second client is provided for other clients for downloading, namely whether other clients establish a link from the second client for downloading.
5) The second client finds that no other client establishes link downloading with the second client, and the server returns the MAC of the second client to the first client at the moment.
6) The second client finds that other clients establish link downloading with the second client, and then turns to the third step, the server judges whether the third client has the unique identification information of the file sent by the first client, namely whether the third client has the file requested by the first client.
7) The third client retrieves that there is no file requested by the first client, which moves to the third step. The server determines whether the fourth client has the unique identification information of the file sent by the first client, that is, whether the fourth client has the file requested by the first client.
8) In this way, when the server searches whether the nth client side has the file requested by the first client side, if the nth client side has the file requested by the first client side and the nth client side is not provided for other client sides to download, the server directly returns to the nth client side.
9) And if the Mth client side has the file requested by the first client side and is provided for other client sides to download and does not exceed the maximum value provided for other client sides to download by the system configuration client side, the Mth client side is taken as a candidate, otherwise, the third step is carried out, and the next client side is continuously judged.
10) And if the Nth client side has the file requested by the first client side and is provided for other client sides to download and does not exceed the maximum value provided for other client sides to download by the system configuration client side, taking the Nth client side as a candidate, otherwise, turning to the third step, and continuously judging the next client side.
11) And if the number of times of downloading provided by the Nth client to other clients is less than the number of times of downloading provided by the Mth client to other clients, the Nth client is used as a candidate, otherwise, the Mth client is used as a candidate, namely, the client with the least downloading number is used as the candidate optimal client.
12) If the following clients do not exist in all other terminals: and if the file requested by the first client exists and is not downloaded in a link with other clients, the server returns the alternative optimal client. And if the alternative optimal client does not exist, the first client downloads from the server.
13) Therefore, load balance is achieved, and point-to-point efficient downloading in the same local area network is guaranteed.
In summary, it is imperative to use the characteristics of the switch to implement the point-to-point transmission scheme of the local area network, and the advantages of the scheme are as follows:
in a local area network, after a first client accesses a switch, the switch actively reports relevant information of the switch to the client by using an LLDP protocol (here, corresponding configuration can be performed on the switch, but this is a default opening item), such as a switch name, a switch MAC, a switch speed, and the like. The client reports the switch information and the file transmission information to the server; when the first client sends a download request to the server, the server responds the second client which has the file in the same local area network and preferentially exists in the same switch to the first client, and then the first client can directly download the file from the second client side in the same switch.
In order to balance load, when a plurality of clients simultaneously request the same file, the server searches other clients with the file in the same switch, and preferentially selects the client without the download request to download, rather than downloading from only one terminal. When the download request of each client reaches the maximum value or other clients under the same switch do not have the file, the server selects to download from the server.

Claims (4)

1. A method for P2P transmission under the same switch is characterized in that the method comprises three parts of link establishment, selection and downloading, wherein:
the link establishing part comprises a data link creating stage and a data requesting stage: in the local area network, after a first client accesses a switch, the switch actively reports switch information to the first client by using an LLDP protocol; the first client reports the switch information and the file transmission information to the server, and sends data downloading request information to the server;
the selection part comprises a data interaction stage and an optimal second client retrieval stage: the server receives the request information of downloading data of the first client and stores the request information; the server side searches all the clients of the same switch under the same local area network, wherein the clients do not include a first client, and searches whether the file requested by the first client exists in all the clients, if one of the clients has the file requested by the first client and no other client establishes a link with the client, the client is used as second client information to be returned to the first client for downloading the requested file;
and the downloading part comprises a step of establishing a data link between the first client and the second client, wherein the first client sends a data downloading request to the second client, and the first client starts to download the file from the second client.
2. The method for P2P transport under the same switch as in claim 1, wherein the creation phase of the data link of the link establishment part is as follows:
the LLDP function of the switch is enabled, then the first client reports the switch information actively reported by the switch to the server, and the server performs overall processing, specifically as follows:
1) the first client and the server are started to establish a link;
2) each first client sends switch information comprising a switch name, a switch MAC and a switch speed to the server at regular time;
3) and the server writes the MAC of the first client into the database according to the name of the switch, the MAC of the switch and the speed information of the switch, so that the first client establishes a corresponding relation with the access switch.
3. The method of P2P transport under a co-switch as claimed in claim 1, wherein the data interaction phase of the selected portion is as follows:
1) a user requests a file on a first client interface, and the first client sends UUID information in file information, namely unique identification information of the file to a server;
2) after receiving the unique identification information of the file sent by the first client, the server firstly retrieves the switch accessed by the first client according to the MAC information of the first client;
3) the server retrieves all the clients accessed under the switch according to the switch accessed by the first client, wherein the clients do not comprise the first client;
4) the server side searches whether a request file of the first client side exists in all client sides of the switch accessed by the first client side, except the first client side, according to the received unique identification information of the file of the first client side;
5) if the server searches that a file which is consistent with the unique identification information of the file requested by the first client exists in one client of the switch accessed by the first client, the server returns the MAC information of the client as a second client to the first client, and the second client is determined at the moment;
6) after receiving the MAC address of the second client responded by the server, the first client actively establishes a link with the second client;
7) after a link is established between a first client and a second client, unique identification information of a file is sent to the second client;
8) the second client receives the request of the first client, retrieves the target file according to the unique identification information of the file, and returns the content of the target file to the first client;
if a plurality of clients simultaneously download the same file, when the server selects a second client, all the clients of the same switch under the same local area network are searched, except the first client, whether the file requested by the first client exists or not is searched from all the clients, if one of the clients has the file requested by the first client and no other client establishes a link with the client, the client is used as the second client to download the requested file.
4. The method of P2P transport under the same switch as in claim 1, wherein the method for the server to select the second client in the retrieval phase of the optimal second client of the selection part is as follows:
1) after receiving the unique identification information of the file sent by the first client, the server firstly retrieves the switch accessed by the first client according to the MAC information of the first client;
2) the server retrieves all the clients accessed under the switch according to the switch accessed by the first client, wherein the clients do not comprise the first client;
3) the server side traverses all the clients, does not include the first client, and judges whether the unique identification information of the file sent by the first client exists in one client, namely whether the file requested by the first client exists in one client;
4) if a certain client searches for a file which is not requested by the first client, the client cannot serve as a second client, and then the step is turned to 3), and the rest clients which are not traversed are continuously judged;
5) if a certain client retrieves the file requested by the first client, judging whether the client is provided for other clients for downloading or not, wherein the client does not comprise the first client, namely whether other clients establish a link from the client for downloading or not;
5) if a certain client finds that no other client establishes link downloading with the client, the server returns the MAC information of the client as a second client to the first client at the moment, the second client is confirmed at the moment, and the process is ended;
6) if a certain client finds that other clients establish link downloading with the client, whether the downloading number of the client exceeds the system configuration is judged, namely whether the maximum value of the downloading provided by the certain client for the other clients exceeds the system configuration is judged;
7) if the maximum value provided by a certain client for other clients to download exceeds the system configuration and the client cannot serve as a second client, turning to 3), and continuing to judge the rest clients which are not traversed;
8) if the maximum value provided by a certain client for other clients to download does not exceed the system configuration, the server stores the minimum values downloaded by all the clients as optimal values;
9) judging whether the server completes traversal of all the clients, if not, turning to 3), and continuing to judge the rest clients which are not traversed;
10) and if the server finishes traversing all the clients, the server returns the client information with the optimal value to the first client to be used as the second client, and the process is ended.
CN202010756590.6A 2020-07-31 2020-07-31 Method for P2P transmission under same switch Pending CN114095508A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010756590.6A CN114095508A (en) 2020-07-31 2020-07-31 Method for P2P transmission under same switch

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010756590.6A CN114095508A (en) 2020-07-31 2020-07-31 Method for P2P transmission under same switch

Publications (1)

Publication Number Publication Date
CN114095508A true CN114095508A (en) 2022-02-25

Family

ID=80295071

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010756590.6A Pending CN114095508A (en) 2020-07-31 2020-07-31 Method for P2P transmission under same switch

Country Status (1)

Country Link
CN (1) CN114095508A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785901A (en) * 2022-03-28 2022-07-22 宁波一网信息技术有限公司 Image retrieval method and system

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20000042919A (en) * 1998-12-28 2000-07-15 윤종용 Method for transmitting messages between asynchronous transfer mode switch and web clients of personal computers
CN1897588A (en) * 2006-06-21 2007-01-17 北京北大方正电子有限公司 Mixed-mode network file transmitting method and system
CN101277231A (en) * 2008-04-29 2008-10-01 北京星网锐捷网络技术有限公司 Method and system for detecting wireless access points, switch and client terminal
CN101325611A (en) * 2008-07-30 2008-12-17 金蝶软件(中国)有限公司 Point-to-point download method and apparatus
US20110103396A1 (en) * 2009-10-29 2011-05-05 International Business Machines Corporation Selective link aggregation in a virtualized environment
CN102299859A (en) * 2011-09-20 2011-12-28 北京星网锐捷网络技术有限公司 Mutual information forwarding method and device
CN102404396A (en) * 2011-11-14 2012-04-04 北京星网锐捷网络技术有限公司 Method, device and system for identifying peer-to-peer (P2P) flow and equipment
CN102780779A (en) * 2012-07-23 2012-11-14 北京星网锐捷网络技术有限公司 Gateway equipment and method and device for optimization of campus network export P2P (peer-to-peer) traffic
US20130315097A1 (en) * 2012-05-22 2013-11-28 Brocade Communications Systems, Inc. Client auto-configuration in a multi-switch link aggregation
CN106603257A (en) * 2015-10-15 2017-04-26 北京艾科网信科技有限公司 Method for determining association relationship between station and switch port
CN107404526A (en) * 2017-07-25 2017-11-28 桂林电子科技大学 P2P remotely-sensed data network self-adapting dissemination systems and method based on SDN
CN107682208A (en) * 2017-11-08 2018-02-09 西南民族大学 A kind of SDN piggy back service quality acquisition method based on LLDP agreements
US10142160B1 (en) * 2011-10-04 2018-11-27 Big Switch Networks, Inc. System and methods for managing network hardware address requests with a controller
CN110768823A (en) * 2019-10-11 2020-02-07 南京理工大学 Software defined network topology discovery method based on LLDP

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20000042919A (en) * 1998-12-28 2000-07-15 윤종용 Method for transmitting messages between asynchronous transfer mode switch and web clients of personal computers
CN1897588A (en) * 2006-06-21 2007-01-17 北京北大方正电子有限公司 Mixed-mode network file transmitting method and system
CN101277231A (en) * 2008-04-29 2008-10-01 北京星网锐捷网络技术有限公司 Method and system for detecting wireless access points, switch and client terminal
CN101325611A (en) * 2008-07-30 2008-12-17 金蝶软件(中国)有限公司 Point-to-point download method and apparatus
US20110103396A1 (en) * 2009-10-29 2011-05-05 International Business Machines Corporation Selective link aggregation in a virtualized environment
CN102299859A (en) * 2011-09-20 2011-12-28 北京星网锐捷网络技术有限公司 Mutual information forwarding method and device
US10142160B1 (en) * 2011-10-04 2018-11-27 Big Switch Networks, Inc. System and methods for managing network hardware address requests with a controller
CN102404396A (en) * 2011-11-14 2012-04-04 北京星网锐捷网络技术有限公司 Method, device and system for identifying peer-to-peer (P2P) flow and equipment
US20130315097A1 (en) * 2012-05-22 2013-11-28 Brocade Communications Systems, Inc. Client auto-configuration in a multi-switch link aggregation
CN102780779A (en) * 2012-07-23 2012-11-14 北京星网锐捷网络技术有限公司 Gateway equipment and method and device for optimization of campus network export P2P (peer-to-peer) traffic
CN106603257A (en) * 2015-10-15 2017-04-26 北京艾科网信科技有限公司 Method for determining association relationship between station and switch port
CN107404526A (en) * 2017-07-25 2017-11-28 桂林电子科技大学 P2P remotely-sensed data network self-adapting dissemination systems and method based on SDN
CN107682208A (en) * 2017-11-08 2018-02-09 西南民族大学 A kind of SDN piggy back service quality acquisition method based on LLDP agreements
CN110768823A (en) * 2019-10-11 2020-02-07 南京理工大学 Software defined network topology discovery method based on LLDP

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
侯重远;江汉红;芮万智;刘亮;: "面向交换式电力监测网的NTP同步精度提高方法", 电力自动化设备, no. 01, 10 January 2013 (2013-01-10) *
郑石平;冯学智;: "基于TCP的跨网段文件传输", 计算机工程与设计, no. 05, 16 March 2007 (2007-03-16) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114785901A (en) * 2022-03-28 2022-07-22 宁波一网信息技术有限公司 Image retrieval method and system
CN114785901B (en) * 2022-03-28 2024-06-11 宁波一网信息技术有限公司 Image retrieval method and system

Similar Documents

Publication Publication Date Title
US6574663B1 (en) Active topology discovery in active networks
EP1542409B1 (en) Protocol for multi-hop ad-hoc networks
KR100576935B1 (en) Ontology-based service discovery system and method for ad hoc networks
US7894372B2 (en) Topology-centric resource management for large scale service clusters
US7978631B1 (en) Method and apparatus for encoding and mapping of virtual addresses for clusters
US9077554B1 (en) Simplified method for processing multiple connections from the same client
CN107547661B (en) Container load balancing implementation method
US20150052252A1 (en) Method and system for optimizing a network by independently scaling control segments and data flow
CN103716281B (en) control method, electronic device and server
WO2010127618A1 (en) System and method for implementing streaming media content service
WO2011113289A1 (en) Service routing method and service network
US8966107B2 (en) System and method of streaming data over a distributed infrastructure
CN101072166A (en) System and method for realizing network reserved storage
WO2008087374A2 (en) SYSTEM AND METHOD FOR REMOTELY ACCESSING UNIVERSAL PLUG AND PLAY (UPnP) NETWORKS
WO2011069387A1 (en) Network node, method for data query and method for index update thereof
KR20090053532A (en) Apparatus and method for setting role based on capability of terminal
KR20050040166A (en) Proxy for controlling device of home-network and method thereof
CN103560962A (en) Method for automatically updating host routing table entries of Ethernet switch and switch
JP2005109539A (en) System, method, and program for retrieving and distributing contents
TW202103475A (en) Method for terminal device management, server and terminal device
CN114095508A (en) Method for P2P transmission under same switch
CN106790502B (en) Load balancing system of IPv4 terminal and IPv6 service intercommunication service based on NAT64 prefix
CN111800516A (en) Internet of things equipment management method and device based on P2P
Hu et al. PLI-Sync: Prefetch Loss-Insensitive Sync for NDN Group Streaming
CN116708538A (en) Micro-service system based on peer-to-peer network

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination