Summary of the invention
Embodiments of the invention provide a kind of method and apparatus of the discovering network media server based on DHCP, solved when DLNA client terminal to discover DLNA server, the network equipment to the downward process of DLNA server is had relatively high expectations, and while there is a plurality of DLNA server on network, DLNA client will be found a plurality of DLNA servers, cannot carry out the problem of load balancing.
For achieving the above object, embodiments of the invention adopt following technical scheme:
First aspect, provides a kind of method of the discovering network media server based on DHCP, comprising:
The web medium server load information of storing in the gateway location information that DHCP equipment obtains according to DHCP equipment and DHCP equipment, determines the web medium server communicating with client;
To gateway, send the address of definite web medium server.
In the possible implementation of the first, described DHCP equipment is DHCP relay equipment or Dynamic Host Configuration Protocol server, wherein, the address of described web medium server comprises the internet IP address of described web medium server, or the address of described web medium server comprises the port numbers of the port communicating with described client on the internet IP address of described web medium server and described web medium server.
In conjunction with the possible implementation of the first of first aspect, in the possible implementation of the second, if described DHCP equipment is DHCP relay equipment, the web medium server load information of storing in the gateway location information of obtaining according to DHCP equipment at described DHCP equipment and DHCP equipment, before determining the web medium server communicating with client, described method also comprises:
Receive the address assignment request that described gateway sends, described address assignment request is that DHCP finds message or DHCP request message;
According to the port numbers that receives the first port of described address assignment request on described DHCP relay equipment, determine described gateway location information, wherein, described gateway location information comprises the port numbers of first end mouth, or, described gateway location information comprises the veneer number of the port numbers of first end mouth and the veneer at the first port place, or described gateway location information comprises the port numbers of first end mouth, the frame number of the frame at the veneer of the veneer at the first port place number and described veneer place.
In conjunction with the possible implementation of the first of first aspect, in the third possible implementation, if described DHCP equipment is Dynamic Host Configuration Protocol server, the web medium server load information of storing in the gateway location information of obtaining according to DHCP equipment at described DHCP equipment and DHCP equipment, before determining the web medium server communicating with client, described method also comprises:
Receive the first address assignment request that DHCP relay equipment sends, described the first address assignment request is carried the gateway location information of described gateway, described gateway location information comprises that described DHCP relay equipment receives the port numbers of the first port of the second address assignment request that described gateway sends, or, described gateway location information comprises that described DHCP relay equipment receives the port numbers of the first port of the second address assignment request and the veneer number of the veneer at the first port place that described gateway sends, or, described gateway location information comprises that described DHCP relay equipment receives the port numbers of the first port of the second address assignment request that described gateway sends, the frame number of the frame at the veneer of the veneer at the first port place number and veneer place,
Wherein, described the second address assignment request is that the DHCP that described gateway sends finds message, described the first address assignment request is that described DHCP relay equipment receives that the described DHCP that described gateway sends finds after message, and according to DHCP, DHCP that obtain, that carry option Option82 finds message;
Or,
Wherein, the second address assignment request is the DHCP request message that described gateway sends, described the first address assignment request is that described DHCP relay equipment is received after the described DHCP request message of described gateway transmission, the DHCP request message that obtain, that carry option Option82 according to DHCP.
In conjunction with the possible implementation of the first of first aspect or first aspect to any one mode in the third possible implementation, in the 4th kind of possible implementation, described web medium server is DLNA DLNA server or the server based on HTML (Hypertext Markup Language) HTTP; Described client is DLNA client;
Described method also comprises:
Described DHCP equipment is sent to described gateway by the address of the described gateway getting based on DHCP.
Second aspect, provides the method for the another kind of discovering network media server based on DHCP, comprising:
Gateway sends address assignment request to DHCP equipment;
Receive the address assignment response that described DHCP equipment sends, described address assignment response comprises the address of the web medium server that described DHCP equipment is definite;
Gateway in the situation that do not receive the request that triggering gateway that DLNA DLNA client sends authenticates, sends authentication request to definite web medium server;
After by described definite web medium server authentication, receive described definite web medium server relevant information that described definite web medium server sends;
To described DLNA client, send described definite web medium server relevant information, described definite web medium server relevant information is used for responding described registration request.
In the possible implementation of the first, describedly to described DLNA client, send described definite web medium server relevant information and comprise:
To described DLNA groups of clients, broadcast and send described definite web medium server relevant information; Or,
After receiving request message, to the DLNA client clean culture that sends described request message, send described definite web medium server relevant information.
In conjunction with the possible implementation of the first of second aspect or second aspect, in the possible implementation of the second, the address of described web medium server comprises the internet IP address of described web medium server, or the address of described web medium server comprises the port numbers of the port communicating with described client on the internet IP address of described web medium server and described web medium server.
In conjunction with the possible implementation of the first of second aspect or second aspect or the possible implementation of the second, in the third possible implementation, described web medium server relevant information comprises: the business that described definite web medium server can provide.
In conjunction with the possible implementation of the first of second aspect or second aspect to any one mode in the third possible implementation, in the 4th kind of possible implementation, described address assignment response also comprises: the address of the described gateway that described DHCP equipment gets based on DHCP.
The third aspect, provides a kind of DHCP equipment, comprising:
Processor, the web medium server load information of storing for the gateway location information obtained according to DHCP equipment and DHCP equipment, determines the web medium server communicating with client;
Transmitter, for sending the address of definite web medium server to gateway.
In the possible implementation of the first, described DHCP equipment is DHCP relay equipment or Dynamic Host Configuration Protocol server, wherein, the address of described web medium server comprises the internet IP address of described web medium server, or the address of described web medium server comprises the port numbers of the port communicating with described client on the internet IP address of described web medium server and described web medium server.
In a kind of possible implementation in conjunction with second aspect, in the possible implementation of the second, if described DHCP equipment is DHCP relay equipment, described DHCP equipment also comprises:
Receiver, the web medium server load information of storing for the gateway location information obtained according to DHCP equipment at described DHCP equipment and DHCP equipment, before determining the web medium server communicating with client, receive the address assignment request that described gateway sends, described address assignment request is that DHCP finds message or DHCP request message;
Described processor, also for determining described gateway location information according to the port numbers that receives the first port of described address assignment request on described DHCP relay equipment, wherein, described gateway location information comprises the port numbers of first end mouth, or, described gateway location information comprises the veneer number of the port numbers of first end mouth and the veneer at the first port place, or described gateway location information comprises the port numbers of first end mouth, the frame number of the frame at the veneer of the veneer at the first port place number and described veneer place.
In a kind of possible implementation in conjunction with second aspect, in the third possible implementation, if described DHCP equipment is Dynamic Host Configuration Protocol server, described receiver, the web medium server load information of also storing for the gateway location information obtained according to DHCP equipment at described DHCP equipment and DHCP equipment, before determining the web medium server communicating with client, receive the first address assignment request that DHCP relay equipment sends, described the first address assignment request is carried the gateway location information of described gateway, described gateway location information comprises that described DHCP relay equipment receives the port numbers of the first port of the second address assignment request that described gateway sends, or, described gateway location information comprises that described DHCP relay equipment receives the port numbers of the first port of the second address assignment request and the veneer number of the veneer at the first port place that described gateway sends, or, described gateway location information comprises that described DHCP relay equipment receives the port numbers of the first port of the second address assignment request that described gateway sends, the frame number of the frame at the veneer of the veneer at the first port place number and veneer place,
Wherein, described the second address assignment request is that the DHCP that described gateway sends finds message, described the first address assignment request is that described DHCP relay equipment receives that the described DHCP that described gateway sends finds after message, and according to DHCP, DHCP that obtain, that carry option Option82 finds message;
Or,
Wherein, the second address assignment request is the DHCP request message that described gateway sends, described the first address assignment request is that described DHCP relay equipment is received after the described DHCP request message of described gateway transmission, the DHCP request message that obtain, that carry option Option82 according to DHCP.
In conjunction with the possible implementation of the first of second aspect or second aspect to any one possible implementation in the third possible implementation, in the 4th kind of possible implementation, described web medium server is DLNA DLNA server or the server based on HTML (Hypertext Markup Language) HTTP; Described client is DLNA client;
Described transmitter, also for being sent to described gateway by the address of the described gateway getting based on DHCP.
Fourth aspect, provides a kind of gateway, comprising:
Transmitter, for sending address assignment request to DHCP equipment; In the situation that do not receive the request that the triggering gateway of DLNA DLNA client transmission authenticates, to definite web medium server, send authentication request; To described DLNA client, send described definite web medium server relevant information, described definite web medium server relevant information is used for responding described registration request;
Receiver, the address assignment response sending for receiving described DHCP equipment, described address assignment response comprises the address of the web medium server that described DHCP equipment is definite; After by described definite web medium server authentication, receive described definite web medium server relevant information that described definite web medium server sends.
In the possible implementation of the first, described transmitter, send described definite web medium server relevant information specifically for broadcasting to described DLNA groups of clients; Or, after receiving request message, to the DLNA client clean culture that sends described request message, send described definite web medium server relevant information.
In conjunction with the possible implementation of the first of fourth aspect or fourth aspect, in the possible implementation of the second, the address of described web medium server comprises the internet IP address of described web medium server, or the address of described web medium server comprises the port numbers of the port communicating with described client on the internet IP address of described web medium server and described web medium server.
In conjunction with the possible implementation of the first of fourth aspect or fourth aspect or the possible implementation of the second, in the third possible implementation, described web medium server relevant information comprises: the business that described definite web medium server can provide.
In conjunction with the possible implementation of the first of fourth aspect or fourth aspect to any one mode in the third possible implementation, in the 4th kind of possible implementation, described address assignment response also comprises: the address of the described gateway that described DHCP equipment gets based on DHCP.
The method and apparatus of the discovering network media server based on DHCP that the embodiment of the present invention provides, adopt after such scheme, DHCP equipment is defined as DLNA client to be provided the web medium server of service (being DLNA server) and the address of DLNA server and port information is notified to gateway in dhcp message, so that gateway is not in the situation that receive the request that the triggering gateway of DLNA DLNA client transmission authenticates, to DLNA server, initiate verification process, after authentication success, DLNA server returns to concrete relevant information (as Location, USN etc.).Like this, gateway can be notified above-mentioned web medium server relevant information to DLNA client, so that DLNA client and web medium server communicate, need to not support that multicast message copies from the downward network equipment of DLNA server.Therefore, the requirement that the multicast message of the downward network equipment of DLNA server is copied can be avoided or reduce to the present embodiment.In addition, alternatively, DHCP equipment is according to the positional information of obtaining and the web medium server load information of storage, determine the web medium server communicating with DLNA client, while there is a plurality of DLNA server on network, DHCP equipment can for DLNA client determine position nearer and/or and the less DLNA server of load, to DLNA server is carried out to load balancing.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, rather than whole embodiment.Embodiment based in the present invention, those of ordinary skills, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
In the method for the discovering network media server based on DHCP that the present embodiment provides, can include but not limited to following entity apparatus: DLNA server, DHCP relay equipment, Dynamic Host Configuration Protocol server, gateway, DLNA client etc.
For clearer, embodiment is described, first above-mentioned entity and DLNA and DHCP etc. is simply described.
One, DLNA
DLNA is an alliance organization being comprised of consumer electronics, mobile phone and manufacturer computer.The target of this tissue be to set up a set of can be so that the product of each manufacturer be connected to each other, the industrial standard adapting to mutually, thus realize Digital Life for consumer.
The main several devices (being that DLNA server can include but not limited to) that defined of DLNA:
Digital media server (DMS, Digital Media Server), provide media obtain, record, store and as the device in source;
Digital media player (DMP, Digital Media Player), can find and play or export the device of any media that provided by DMS;
Controller (the DMC of Digital Media, Digital Media Controller), as remote control, use, can find the multimedia file on DMS, and specify the DMP that can play this media file to play or control the device that multimedia file uploads to DMS or downloads from DMS;
Wherein, the core protocol of DLNA is UPnP (The Universal Plug and Play, UPnP) agreement.
Two, DHCP
Can be by DHCP mode automatic acquisition in the present embodiment the IP address for the gateway of communicating by letter, concrete steps can comprise:
1) DHCP finds (DISCOVER)
Gateway can be applied for last IP address that it uses.If this IP is still available in the network at this gateway place, Dynamic Host Configuration Protocol server just can be permitted this application.Otherwise, will see that this Dynamic Host Configuration Protocol server is that authorize or unauthorized.Authorize Dynamic Host Configuration Protocol server can refuse request, make gateway apply at once a new IP.Unauthorized Dynamic Host Configuration Protocol server only neglects request, causes the overtime of gateway requests, so gateway will be abandoned this request and go to apply for a new IP address.
2) DHCP provides (OFFER)
When Dynamic Host Configuration Protocol server is received an IP lease request from gateway, it can provide an IP lease for this gateway.Dynamic Host Configuration Protocol server is that gateway retains an IP address, then by network, sends DHCP OFFER message to client.This DHCP OFFER message can be including but not limited to: the IP etc. that sends MAC Address, IP address, subnet mask, the rental period that server provides of the Dynamic Host Configuration Protocol server of DHCP OFFER and the Dynamic Host Configuration Protocol server of IP is provided.
3) DHCP request (REQUEST)
When gateway is received the DHCP OFFER message that includes IP lease, it must tell every other Dynamic Host Configuration Protocol server it accepted a lease and provide.Therefore, this gateway can send DHCP REQUEST message, and this DHCP REQUEST message can be including but not limited to the IP that the Dynamic Host Configuration Protocol server of lease is provided.When other Dynamic Host Configuration Protocol server have been received after DHCP REQUEST message, they can regain likely offered the lease of gateway.Then they relay the IP address once retaining to gateway to get back in available address, and like this, they just still can distribute this IP address for other computers.The Dynamic Host Configuration Protocol server of any amount can respond the request of same IP lease, but each gateway can only be accepted a lease and provides.
4) DHCP confirms (ACK)
When Dynamic Host Configuration Protocol server receives that after the DHCP REQUEST message from gateway, it has just started the final stage of layoutprocedure.This response phase comprises that transmission DHCP ACK message is to gateway.This DHCP ACK message can be including but not limited to: other all configuration informations that rental period and gateway may be asked.
Three, DHCP relay equipment (being DHCP RELAY)
Early stage DHCP agreement is only suitable for DLNA client and the situation of Dynamic Host Configuration Protocol server in same subnet, cannot cross-network segment work.DHCP RELAY bears relay services at DLNA client and Dynamic Host Configuration Protocol server between different sub-network, DHCP protocol massages can be relayed in the object Dynamic Host Configuration Protocol server or DLNA client of cross-network segment.
As shown in Figure 1, the workflow of DHCP RELAY can comprise:
1) gateway sends address configuration request to DHCP RELAY.If this subnet exists Dynamic Host Configuration Protocol server, do not need DHCP RELAY directly just can carry out dhcp address configuration; If there is no Dynamic Host Configuration Protocol server in this subnet, mail to the network equipment with DHCP RELAY function that present networks is connected;
2) DHCP RELAY receives after the address configuration request of gateway, Option82 (a kind of message name) option is added in this address configuring request, and the address configuration request of having added after Option82 option is sent to Dynamic Host Configuration Protocol server with mode of unicast;
3) Dynamic Host Configuration Protocol server, after receiving the address configuration request of having added after Option82 option, is gateway configuration IP address, and sends DHCP OFFER message to DHCP RELAY, in this DHCP OFFER message, has been added Option82 option;
4) DHCP RELAY, after receiving DHCP OFFER message, deletes the Option82 option adding in DHCP OFFER message, and the DHCP OFFER message of having deleted Option82 option is sent to gateway;
5) gateway sends DHCP REQUEST message to DHCP RELAY after receiving DHCP OFFER message;
6) DHCP RELAY receives after the DHCP REQUEST message of gateway, Option82 (a kind of message name) option is added in this DHCP REQUEST message, and the DHCPREQUEST message of having added after Option82 option is sent to Dynamic Host Configuration Protocol server with mode of unicast;
7) Dynamic Host Configuration Protocol server, after receiving the DHCP REQUEST message of having added after Option82 option, sends DHCP ACK message to DHCP RELAY, in this DHCP ACK message, has been added Option82 option;
8) DHCP RELAY is sent to DLNA client by the IP address of Dynamic Host Configuration Protocol server configuration, so that DLNA client communicates.
Four, option Option82
1) DLNA client broadcast transmission request message when initialization, request message at this moment does not comprise option82;
2) after DHCP RELAY adds option82 to receive request message afterbody, relay forwarding is to Dynamic Host Configuration Protocol server.The sub-option of DHCP option82 can be but be not limited to the interface message of the switch that gateway connects;
3) Dynamic Host Configuration Protocol server is received after the request message of DHCP RELAY forwarding, can, according to the entrained information of option82 option in request message and predetermined policy distributing IP address and out of Memory, then the DHCP REQUEST message with DHCP configuration information and option82 information be issued to DHCP RELAY.
4) DHCP RELAY receives after the DHCP REQUEST message of Dynamic Host Configuration Protocol server the option82 information of peeling off in message, then by the message repeating with DHCP configuration information to gateway.
The scene of the present embodiment application can for but be not limited to: DLNA client is arranged in two different subnets from DLNA server, and Dynamic Host Configuration Protocol server can be arranged in same subnet with DLNA server, and gateway is served as relaying.
The present embodiment provides a kind of method of the discovering network media server based on DHCP, and the executive agent of the method is DHCP equipment, as shown in Figure 1, can comprise:
101, the web medium server load information of storing in the gateway location information that DHCP equipment obtains according to DHCP equipment and DHCP equipment, determines the web medium server communicating with client;
102, to gateway, send the address of definite web medium server, so that gateway is after the authentication of the web medium server by definite, the definite web medium server relevant information receiving is sent to DLNA client, and DLNA client and definite web medium server are communicated.
Adopt after such scheme, DHCP equipment is determined the web medium server communicating with client, and the address of web medium server and port information are notified to gateway, then, gateway in the situation that do not receive the request that triggering gateway that DLNA DLNA client sends authenticates, is initiated verification process to this web medium server; After authentication success, web medium server returns to concrete relevant information, last gateway is notified above-mentioned web medium server relevant information to client, so that client and web medium server communicate, like this, need to not support that multicast message copies from the downward network equipment of web medium server, therefore, avoid the requirement that the multicast message of the downward network equipment of web medium server is copied; Simultaneously, DHCP equipment is according to the positional information of obtaining and the web medium server load information of storage, determine the web medium server communicating with client, while there is a plurality of web medium server on network, DHCP equipment can determine that position is nearer for client, and the web medium server that load is less, to carry out load balancing to web medium server.
The present embodiment provides the method for the another kind of discovering network media server based on DHCP, and the executive agent of the method is gateway, as shown in Figure 2, can comprise:
201, gateway sends address assignment request to DHCP equipment, so that DHCP equipment is determined the web medium server communicating with client according to address assignment request;
202, receive the address assignment response that DHCP equipment sends, address assignment response comprises the address of the web medium server that DHCP equipment is definite;
203, gateway in the situation that do not receive the request that triggering gateway that DLNA DLNA client sends authenticates, sends authentication request to definite web medium server.
204, after the web medium server authentication by definite, receive definite web medium server relevant information that definite web medium server sends;
205, to client, send definite web medium server relevant information, so that client and definite web medium server communicate.
Adopt after such scheme, DHCP equipment is determined the web medium server communicating with client, and the address of web medium server and port information are notified to gateway, then, gateway in the situation that do not receive the request that triggering gateway that DLNA DLNA client sends authenticates, is initiated verification process to this web medium server; After authentication success, web medium server returns to concrete relevant information, last gateway is notified above-mentioned web medium server relevant information to client, so that client and web medium server communicate, like this, need to not support that multicast message copies from the downward network equipment of web medium server, therefore, avoid the requirement that the multicast message of the downward network equipment of web medium server is copied; Simultaneously, DHCP equipment is according to the positional information of obtaining and the web medium server load information of storage, determine the web medium server communicating with client, while there is a plurality of web medium server on network, DHCP equipment can determine that position is nearer for client, and the web medium server that load is less, to carry out load balancing to web medium server.
Web medium server can be, but not limited to as: DLNA server or other are based on HTTP (HTTP-Hypertext transfer protocol, HTML (Hypertext Markup Language)) server, client also can for web medium server to corresponding client.The embodiment providing below all be take web medium server as DLNA server, and client is that DLNA client is that example describes.
The present embodiment provides the method for the another kind of discovering network media server based on DHCP, the method is further expanding the method shown in Fig. 1 and Fig. 2, wherein, DHCP equipment can be: DHCP relay equipment or Dynamic Host Configuration Protocol server, the present embodiment be take DHCP equipment and described as DHCP relay equipment as example.In order to make to be easier to understand the present embodiment, as shown in Figure 3, provide the data interaction figure of method of the discovering network media server based on DHCP of the present embodiment.
The method flow diagram of the discovering network media server based on DHCP of the present embodiment is also provided as shown in Figure 4.
Concrete, as shown in Figure 4, the present embodiment specifically can comprise:
401, gateway sends address assignment request to DHCP relay equipment.
402, DHCP relay equipment receives the address assignment request that gateway sends.
DLNA client (can for but be not limited to DLNA client) before communicating by gateway and network, gateway needs an IP address, therefore, the address assignment request that DHCP relay equipment receives and sends to Dynamic Host Configuration Protocol server forward gateway, so that Dynamic Host Configuration Protocol server is gateway distributing IP address.
Further, address assignment request can be, but not limited to: for DHCP finds message or DHCP request message.
403, DHCP relay equipment adds option82 in address assignment request, and the address assignment request that is added with option82 is sent to Dynamic Host Configuration Protocol server, so that Dynamic Host Configuration Protocol server is gateway, divide the address (being IP address) that is used in communication, option82 can comprise positional information.
The present embodiment is that gateway distributes the method for address to be not construed as limiting to Dynamic Host Configuration Protocol server, for technology well known to those skilled in the art, does not repeat them here.
The present embodiment to for the method for gateway distributing IP address is not construed as limiting, is technology well known to those skilled in the art, and can sets according to actual needs, do not repeat them here.
404, the web medium server load information of storing in the gateway location information that DHCP relay equipment obtains according to DHCP equipment and DHCP equipment, determine the web medium server communicating with client, and receive the address assignment response that Dynamic Host Configuration Protocol server sends.
Address assignment response can be, but not limited to comprise: Dynamic Host Configuration Protocol server is the IP address for communicating by letter that gateway distributes.
Further, DHCP relay equipment can distribute the port numbers of the first port of request to determine gateway location information according to receiver address on DHCP relay equipment, wherein, gateway location information comprises the port numbers of first end mouth, or, gateway location information comprises the veneer number of the port numbers of first end mouth and the veneer at the first port place, or gateway location information comprises the port numbers of first end mouth, the frame number of the frame at the veneer of the veneer at the first port place number and veneer place.
As an embodiment of the present embodiment, DHCP relay equipment can also add the gateway location information getting in corresponding option82 to.
As an embodiment of the present embodiment, DHCP relay equipment is according to the gateway location information of obtaining and the web medium server load information of storage, the method of determining the web medium server communicating with DLNA client (can be called DLNA server, following examples all be take DLNA server and are described as example) can as but be not limited to: DHCP relay equipment obtains nearer apart from gateway location, and the less DLNA server of load.
DHCP relay equipment can replace DLNA client and according to the address of DLNA client and the web medium server load information of storage that obtain, determine the DLNA server communicating with DLNA client.Like this, determine that with DLNA client of the prior art DLNA server compares, evade service that DLNA server need to can provide to DLNA client broadcast DLNA server by its downward network equipment and other information etc., and caused the problem of having relatively high expectations to this network equipment.Meanwhile, while there is at least one DLNA server in system, DHCP relay equipment can be determined a DLNA server that load is less for DLNA client according to the load information of DLNA server, makes the load of at least one DLNA server more balanced.
The present embodiment is not construed as limiting obtaining the method for DLNA server, can set according to actual needs, does not repeat them here.
405, DHCP relay equipment adds the address of definite web medium server in address assignment response to, and to gateway, sends the address assignment response of the address that is added with definite web medium server.
Now, address assignment response can also comprise: the address of definite web medium server and the IP address for communicating by letter of distributing for gateway, DHCP relay equipment is sent to gateway by the address of the gateway getting based on DHCP.
The address of web medium server can be, but not limited to comprise: the internet IP address of web medium server, or, the port numbers of the port communicating with client on the internet IP address of the address packet includes network media server of web medium server and web medium server.
Further, definite DLNA server address can be added in DHCP ACK message and together be sent to gateway, also can be sent to gateway together with other message.Wherein, DHCP ACK message was introduced in above-mentioned specification, did not repeat them here.
The method that the present embodiment subtend gateway sends definite web medium server information is not construed as limiting, and can set according to actual needs, does not repeat them here.
Further, in the address assignment response that the Dynamic Host Configuration Protocol server receiving sends, may be added option82, at DHCP relay equipment, before gateway sends address assignment response, delete the option82 in address assignment response, in the address assignment response that DHCP relay equipment sends to gateway, do not comprise option82.
406, gateway in the situation that do not receive the request that triggering gateway that DLNA DLNA client sends authenticates, sends authentication request to definite web medium server.
407, after the web medium server authentication by definite, receive definite web medium server relevant information that definite web medium server sends.
The content that the present embodiment comprises web medium server relevant information is not construed as limiting, and can set according to actual needs, for example, can comprise business that web medium server can provide etc., does not repeat them here.
The method that the present embodiment authenticates gateway web medium server is not construed as limiting, and for technology well known to those skilled in the art, does not repeat them here.
408, gateway sends definite web medium server relevant information to DLNA client, so that DLNA client and definite web medium server communicate.
Further, the method that sends definite web medium server relevant information to DLNA client can comprise:
To DLNA groups of clients, broadcast and send definite web medium server relevant information; Or,
After receiving request message, to the DLNA client clean culture sending a request message, send definite web medium server relevant information.
Wherein, request message can include but not limited to: SSDP m-search message (SSDP m-query messages) etc., wherein, SSDP m-search message defines in SSDP.
The method that the present embodiment sends definite web medium server relevant information to gateway to DLNA client is not construed as limiting, and can set according to actual needs, does not repeat them here.
The method that the present embodiment communicates DLNA client and definite web medium server is not construed as limiting, and is technology well known to those skilled in the art, and can sets according to actual needs, does not repeat them here.
Adopt after such scheme, DHCP equipment is determined the web medium server (being DLNA server) communicating with DLNA client, and the address of DLNA server and port information are notified to gateway, then, gateway in the situation that do not receive the request that triggering gateway that DLNA DLNA client sends authenticates, is initiated verification process to this DLNA server; After authentication success, DLNA server returns to concrete relevant information (as Location, USN etc.), last gateway is notified above-mentioned web medium server relevant information to DLNA client, so that DLNA client and DLNA server communicate, like this, need to not support that multicast message copies from the downward network equipment of DLNA server, therefore, avoided requirement that the multicast message of the downward network equipment of DLNA server is copied; Simultaneously, DHCP equipment is according to the positional information of obtaining and the DLNA server load information of storage, determine the DLNA server communicating with DLNA client, while there is a plurality of DLNA server on network, DHCP equipment can determine that position is nearer for DLNA client, and the DLNA server that load is less, to carry out load balancing to DLNA server.
The present embodiment provides the method for the another kind of discovering network media server based on DHCP, and the method is to the further expanding of the method shown in Fig. 1 and Fig. 2, and the executive agent of the method is Dynamic Host Configuration Protocol server.
In order to make to be easier to understand the present embodiment, as shown in Figure 5, provide the data interaction figure of method of the discovering network media server based on DHCP of the present embodiment.
The method flow diagram of the discovering network media server based on DHCP of the present embodiment is also provided as shown in Figure 6.
As shown in Figure 6, can comprise:
601, Dynamic Host Configuration Protocol server the first address assignment request of option82 that received interpolation that DHCP relay equipment sends.
Option82 can comprise: gateway location information.
The first address assignment request can be, but not limited to comprise: the gateway location information of gateway.
Gateway location information can be, but not limited to comprise: the port numbers of the first port of the second address assignment request that DHCP relay equipment reception gateway sends; Or,
Gateway location information can be, but not limited to comprise: DHCP relay equipment receives the port numbers of the first port of the second address assignment request and the veneer number of the veneer at the first port place that gateway sends; Or,
Gateway location information can be, but not limited to comprise: DHCP relay equipment receives the port numbers of the first port of the second address assignment request that gateway sends, the frame number of the frame at the veneer of the veneer at the first port place number and veneer place.
Wherein, the DHCP that the second address assignment request can be, but not limited to send into gateway finds message, the first address assignment request can be, but not limited to receive for DHCP relay equipment the DHCP that gateway sends and finds after message, and according to DHCP, DHCP that obtain, that carry option Option82 finds message;
Or,
Wherein, the second address assignment request can be, but not limited to the DHCP request message sending into gateway, the first address assignment request is that DHCP relay equipment is received after the DHCP request message of gateway transmission, the DHCP request message that obtain, that carry option Option82 according to DHCP.
Further, in order to make Dynamic Host Configuration Protocol server, be gateway distributing IP address, gateway sends address assignment request to DHCP relay equipment, then is sent to Dynamic Host Configuration Protocol server after DHCP relay equipment adds in this address assignment request by option82.
602, the web medium server load information of storing in the gateway location information that Dynamic Host Configuration Protocol server obtains according to Dynamic Host Configuration Protocol server and Dynamic Host Configuration Protocol server, determines the web medium server communicating with client, and divides the IP address that is used in communication for gateway.
Further, DHCP equipment is sent to gateway by the address of the gateway getting based on DHCP.
Dynamic Host Configuration Protocol server can be not only gateway distributing IP address, but also can replace DLNA client according to the gateway location information of obtaining from option82 and the web medium server load information of storage, determine the DLNA server communicating with DLNA client.Like this, determine that with DLNA client of the prior art DLNA server compares, evade service that DLNA server need to can provide to DLNA client broadcast DLNA server by its downward network equipment and other information etc., and caused the problem of having relatively high expectations to this network equipment.Meanwhile, while there is at least one DLNA server in system, DHCP relay equipment can be determined a DLNA server that load is less for DLNA client according to the load information of DLNA server, makes the load of at least one DLNA server more balanced.
The present embodiment to for the method for gateway distributing IP address is not construed as limiting, is technology well known to those skilled in the art, and can sets according to actual needs, do not repeat them here.
603, Dynamic Host Configuration Protocol server sends address assignment response to DHCP relay equipment.
Address assignment response can be, but not limited to comprise: the address of definite web medium server and the IP address for communicating by letter of distributing for gateway, so that DHCP relay equipment sends address assignment response to gateway.
Further, the address of web medium server can be, but not limited to comprise: the internet IP address of web medium server, or, the port numbers of the port communicating with client on the internet IP address of the address packet includes network media server of web medium server and web medium server.
604, DHCP relay equipment phase gateway sends address assignment response.
605, gateway in the situation that do not receive the request that triggering gateway that DLNA DLNA client sends authenticates, sends authentication request to definite web medium server.
606, after the web medium server authentication by definite, receive definite web medium server relevant information that definite web medium server sends.
607, gateway sends definite web medium server relevant information to DLNA client, so that DLNA client and definite web medium server communicate.
The embodiment of each step of the present embodiment, similar with the execution mode of the embodiment shown in Fig. 5, do not repeat them here.
Adopt after such scheme, DHCP equipment is determined the web medium server (being DLNA server) communicating with DLNA client, and the address of DLNA server and port information are notified to gateway, then, gateway in the situation that do not receive the request that triggering gateway that DLNA DLNA client sends authenticates, is initiated verification process to this DLNA server; After authentication success, DLNA server returns to concrete relevant information (as Location, USN etc.), last gateway is notified above-mentioned web medium server relevant information to DLNA client, so that DLNA client and DLNA server communicate, like this, need to not support that multicast message copies from the downward network equipment of DLNA server, therefore, avoided requirement that the multicast message of the downward network equipment of DLNA server is copied; Simultaneously, DHCP equipment is according to the positional information of obtaining and the DLNA server load information of storage, determine the DLNA server communicating with DLNA client, while there is a plurality of DLNA server on network, DHCP equipment can determine that position is nearer for DLNA client, and the DLNA server that load is less, to carry out load balancing to DLNA server.
Some device embodiment are provided below, and the device embodiment providing is corresponding with said method embodiment, and the implementation method of device and device receiver, determiner and the transmitter etc. that comprise is identical with the method for recording in embodiment of the method accordingly.
The present embodiment provides a kind of DHCP equipment, as shown in Figure 7, can comprise:
Processor 71, the web medium server load information of storing for the gateway location information obtained according to DHCP equipment and DHCP equipment, determines the web medium server communicating with client;
Transmitter 72, for sending the address of definite web medium server to gateway.
Adopt after such scheme, the web medium server load information of storing in the gateway location information that determiner obtains according to DHCP equipment and DHCP equipment, determine the web medium server communicating with client, transmitter sends the address of definite web medium server to gateway, then, in the situation that do not receive the request that the triggering gateway of DLNA DLNA client transmission authenticates, to this web medium server, initiate verification process; After authentication success, web medium server returns to concrete relevant information, last gateway is notified above-mentioned web medium server relevant information to client, so that client and web medium server communicate, like this, need to not support that multicast message copies from the downward network equipment of web medium server, therefore, avoid the requirement that the multicast message of the downward network equipment of web medium server is copied; Simultaneously, determiner is according to the positional information of obtaining and the web medium server load information of storage, determine the web medium server communicating with client, while there is a plurality of web medium server on network, determiner can determine that position is nearer for client, and the web medium server that load is less, to carry out load balancing to web medium server.
The present embodiment provides another kind of DHCP equipment, and this DHCP equipment is that as shown in Figure 8, DHCP equipment can comprise to the further expanding of the DHCP equipment shown in Fig. 7:
Processor 81, the web medium server load information of storing for the gateway location information obtained according to DHCP equipment and DHCP equipment, determines the web medium server communicating with client;
Transmitter 82, for sending the address of definite web medium server to gateway.
Further, DHCP equipment is DHCP relay equipment or Dynamic Host Configuration Protocol server, wherein, the internet IP address of the address packet includes network media server of web medium server, or, the port numbers of the port communicating with client on the internet IP address of the address packet includes network media server of web medium server and web medium server.
Further, if DHCP equipment is DHCP relay equipment, DHCP equipment also comprises:
Receiver 83, the web medium server load information of storing for the gateway location information obtained according to DHCP equipment at DHCP equipment and DHCP equipment, before determining the web medium server communicating with client, receive the address assignment request that gateway sends, address assignment request is that DHCP finds message or DHCP request message;
Processor 81, also for distributing the port numbers of the first port of request to determine gateway location information according to receiver address on DHCP relay equipment, wherein, gateway location information comprises the port numbers of first end mouth, or, gateway location information comprises the veneer number of the port numbers of first end mouth and the veneer at the first port place, or gateway location information comprises the port numbers of first end mouth, the frame number of the frame at the veneer of the veneer at the first port place number and veneer place.
Further, if DHCP equipment is Dynamic Host Configuration Protocol server, receiver 83, the web medium server load information of also storing for the gateway location information obtained according to DHCP equipment at DHCP equipment and DHCP equipment, before determining the web medium server communicating with client, receive the first address assignment request that DHCP relay equipment sends, the first address assignment request is carried the gateway location information of gateway, gateway location information comprises the port numbers of the first port of the second address assignment request that DHCP relay equipment reception gateway sends, or, gateway location information comprises that DHCP relay equipment receives the port numbers of the first port of the second address assignment request and the veneer number of the veneer at the first port place that gateway sends, or, gateway location information comprises the port numbers of the first port of the second address assignment request that DHCP relay equipment reception gateway sends, the frame number of the frame at the veneer of the veneer at the first port place number and veneer place,
Wherein, the second address assignment request is that the DHCP that gateway sends finds message, and the first address assignment request is that DHCP relay equipment receives that the DHCP that gateway sends finds after message, and according to DHCP, DHCP that obtain, that carry option Option82 finds message;
Or,
Wherein, the second address assignment request is the DHCP request message that gateway sends, and the first address assignment request is that DHCP relay equipment is received after the DHCP request message of gateway transmission, the DHCP request message that obtain, that carry option Option82 according to DHCP.
Further, web medium server is DLNA DLNA server or the server based on HTML (Hypertext Markup Language) HTTP; Client is DLNA client;
Transmitter 82, also for being sent to gateway by the address of the gateway getting based on DHCP.
Adopt after such scheme, the web medium server load information of storing in the gateway location information that determiner obtains according to DHCP equipment and DHCP equipment, determine the web medium server communicating with client, transmitter sends the address of definite web medium server to gateway, then, in the situation that do not receive the request that the triggering gateway of DLNA DLNA client transmission authenticates, to this DLNA server, initiate verification process; After authentication success, DLNA server returns to concrete relevant information (as Location, USN etc.), last gateway is notified above-mentioned web medium server relevant information to DLNA client, so that DLNA client and DLNA server communicate, like this, need to not support that multicast message copies from the downward network equipment of DLNA server, therefore, avoided requirement that the multicast message of the downward network equipment of DLNA server is copied; Simultaneously, determiner is according to the positional information of obtaining and the DLNA server load information of storage, determine the DLNA server communicating with DLNA client, while there is a plurality of DLNA server on network, determiner can determine that position is nearer for DLNA client, and the DLNA server that load is less, to carry out load balancing to DLNA server.
The present embodiment provides a kind of gateway, as shown in Figure 9, can comprise:
Transmitter 91, for sending address assignment request to DHCP equipment; In the situation that do not receive the request that the triggering gateway of DLNA DLNA client transmission authenticates, to definite web medium server, send authentication request; To DLNA client, send definite web medium server relevant information, definite web medium server relevant information is used for responding registration request;
Receiver 92, the address assignment response sending for receiving DHCP equipment, address assignment response comprises the address of the web medium server that DHCP equipment is definite; After the web medium server authentication by definite, receive definite web medium server relevant information that definite web medium server sends.
Further, transmitter 91, send definite web medium server relevant information specifically for broadcasting to DLNA groups of clients; Or, after receiving request message, to the DLNA client clean culture sending a request message, send definite web medium server relevant information.
Further, the internet IP address of the address packet includes network media server of web medium server, or, the port numbers of the port communicating with client on the internet IP address of the address packet includes network media server of web medium server and web medium server.
Further, web medium server relevant information comprises: the business that definite web medium server can provide.
Further address assignment response also comprises: the address of the gateway that DHCP equipment gets based on DHCP.
Adopt after such scheme, DHCP equipment is determined the web medium server (being DLNA server) communicating with DLNA client, and the address of DLNA server and tcp port information are notified to gateway, then, gateway in the situation that do not receive the request that triggering gateway that DLNA DLNA client sends authenticates, is initiated verification process to this DLNA server; After authentication success, DLNA server returns to concrete relevant information (as Location, USN etc.), last transmitter is notified above-mentioned web medium server relevant information to DLNA client, so that DLNA client and DLNA server communicate, like this, need to not support that multicast message copies from the downward network equipment of DLNA server, therefore, avoided requirement that the multicast message of the downward network equipment of DLNA server is copied; Simultaneously, DHCP equipment is according to the positional information of obtaining and the DLNA server load information of storage, determine the DLNA server communicating with DLNA client, while there is a plurality of DLNA server on network, DHCP equipment can determine that position is nearer for DLNA client, and the DLNA server that load is less, to carry out load balancing to DLNA server.
The present embodiment provides a kind of system of the discovering network media server based on DHCP, as shown in figure 10, can comprise:
The DHCP equipment 101 and the gateway 102 that in device embodiment, provide.
The DHCP equipment 101 providing in the present embodiment is identical with the execution mode of the DHCP equipment 101 providing in said apparatus embodiment and gateway 102 with the execution mode of gateway 102, does not repeat them here.
Adopt after such scheme, DHCP equipment is determined the web medium server (being DLNA server) communicating with DLNA client, and the address of DLNA server and port information are notified to gateway, then, gateway in the situation that do not receive the request that triggering gateway that DLNA DLNA client sends authenticates, is initiated verification process to this DLNA server; After authentication success, DLNA server returns to concrete relevant information (as Location, USN etc.), last gateway is notified above-mentioned web medium server relevant information to DLNA client, so that DLNA client and DLNA server communicate, like this, need to not support that multicast message copies from the downward network equipment of DLNA server, therefore, avoided requirement that the multicast message of the downward network equipment of DLNA server is copied; Simultaneously, DHCP equipment is according to the positional information of obtaining and the DLNA server load information of storage, determine the DLNA server communicating with DLNA client, while there is a plurality of DLNA server on network, DHCP equipment can determine that position is nearer for DLNA client, and the DLNA server that load is less, to carry out load balancing to DLNA server.
Through the above description of the embodiments, those skilled in the art can be well understood to the mode that the present invention can add essential common hardware by software and realize, and can certainly pass through hardware, but in a lot of situation, the former is better execution mode.Understanding based on such, the part that technical scheme of the present invention contributes to prior art in essence in other words can embody with the form of software product, this computer software product is stored in the storage medium can read, as the floppy disk of computer, hard disk or CD etc., comprise some instructions with so that computer equipment (can be personal computer, server, or the network equipment etc.) carry out the method described in each embodiment of the present invention.
The above; be only the specific embodiment of the present invention, but protection scope of the present invention is not limited to this, is anyly familiar with those skilled in the art in the technical scope that the present invention discloses; can expect easily changing or replacing, within all should being encompassed in protection scope of the present invention.Therefore, protection scope of the present invention should be as the criterion by the described protection range with claim.