The system for setting network parameters 100 is arranged in a network device 10. A client 30 is connected to the network device 10 via a network 20. In this embodiment, the network device may be an access point, a wireless modem, and so on. The network 20 may be the Internet, an Intranet, and so on. The client 30 may be a personal computer (PC), a personal digital assistant (PDA), a set top box, and so on.
The system 100 includes a detecting module 110, an authentication module 120, a packet determining module 130, a parameter storage module 140, a transmission module 150, a parameter setting module 160, a storage requesting module 170, and a reboot module 180.
The detecting module 110 detects a session request packet from the client 30 via a port. In this embodiment, the detecting module 110 detects the session request packet via a port 55600.
The authentication module 120 authenticates the client 30. In this embodiment, the authentication module 120 includes a network-segment determining sub-module 1202, a session sub-module 1204, a parsing sub-module 1206, and an information checking sub-module 1208.
The network-segment determining sub-module 1202 determines whether the client 30 is in a valid network segment. The valid network segment refers to a network segment that the client 30 is allowed to visit. In this embodiment, the network-segment determining sub-module 1202 determines whether a client 30 is in the valid network segment by checking an Internet protocol (IP) address and a subnet mask of the packet.
The session sub-module 1204 establishes a session with a client 30 in a valid network segment. In this embodiment, a session refers to a communication between a port of the client 30 and that of the network device 10.
The parsing sub-module 1206 parses a packet from the client 30 in a valid network segment, to determine whether the packet includes user information. In this embodiment, the user information includes a username and a password. In detail, the parsing sub-module 1206 parses a payload field in the packet, to determine whether the payload field includes the username and the password.
The information checking sub-module 1208 checks the packet from the client 30 in a valid network segment, to determine whether the packet includes correct user information. In detail, the information checking sub-module 1208 determines whether the username and the password in the packet are correct.
The packet determining module 130 determines types of packets from the client 30. In this embodiment, the types of packets include a GET packet, a SET packet, a SAVE packet, and a REBOOT packet. The packet determining module 130 determines the types of packets by checking a code field of each of the packets.
If the packet determining module 130 determines the code field of a packet is set to 0x01, that indicates the packet is a GET packet. A typical format of the GET packet is as follows:
An IP field, a UPnP field, a WEP field and a NAPT field respectively indicate an Internet protocol (IP) address, a universal plug and play protocol (UPnP) function, a wireless equivalent privacy (WEP) function, and a network address and protocol translation (NAPT) function.
If the packet determining module 130 determines the code field of a packet is 0x02, that indicates the packet is a SET packet. The SET packet indicates network parameters of the client 30. A typical format of the SET packet is as follows:
If the packet determining module 130 determines the code field of a packet is 0x07, that indicates the packet is a SAVE packet. The SAVE packet is a request for saving network parameters of the network device 10 and the client 30. A typical format of the SAVE packet is as follows:
If the packet determining module 130 determines the code field of a packet is 0x06, that indicates the packet is a REBOOT packet. The REBOOT packet is a request for rebooting the network device 10 and the client 30. A typical format of the REBOOT packet is as follows:
The parameter storage module 140 stores the network parameters of the network device 10 and the client 30. For example, the network parameters of the network device 10 are preset to UPnP=0, IP=192.168.0.10, NAPT=1, WEP=1, and the network parameters of the client 30 are preset to UPnP=1, IP=192.168.0.242, NAPT=0, WEP=0.
The transmission module 150 transmits corresponding response packets to the client 30 according to the types of the packets from the client 30. In this embodiment, if a packet from the client 30 is the GET packet, a corresponding response packet is a GET response packet. The GET response packet indicates the network parameters of the network device 10. A typical format of the GET response packet is as follows:
The GET response packet indicates an IP address of the network device 10 is 102.168.0.10, the UPnP function thereof is not enabled, and the WEP and the NAPT functions thereof are enabled.
If the packet from the client 30 is the SET packet, a corresponding response packet is a SET response packet. A typical format of the SET response packet is as follows:
The SET response packet indicates the network parameters of the network device 10 have been successfully set.
If the packet from the client 30 is the SAVE packet, a corresponding response packet is a SAVE response packet. A typical format of the SAVE response packet is as follows:
The SAVE response packet indicates the network parameters of the network device 10 and the client 30 have been successfully saved.
If the packet from the client 30 is the REBOOT packet, a corresponding response packet is a REBOOT response packet. A typical format of the REBOOT response packet is as follows:
The REBOOT response packet indicates the network device 10 and the client 30 have been successfully rebooted.
The parameter setting module 160 sets the network parameters of the network device 10 and the client 30. In detail, the parameter setting module 160 sets a UPnP value of the network device 10 according to that of the client 30, and sets an IP address, a NAPT value, and a WEP value of the client 30 according to those of the network device 10. In this embodiment, the parameter setting module 160 sets the UPnP value of the network device 10 to 1, and sets the IP address, the WEP value, and the NAPT value of the client 30, to 192.168.0.10, 1, and 1, respectively.
The storage requesting module 170 requests the parameter storage module 140 to store the network parameters of the network device 10 and the client 30 according to the SAVE packet.
The reboot module 180 reboots the network device 10 and the client 30 according to the REBOOT packet.
In step S302, the detecting module 110 detects the session request packet from the client 30 via the port.
In step S304, the authentication module 120 authenticates the client 30, to prevent unauthorized users from logging onto the network device 10 and setting network parameters thereof.
In step S306, the detecting module 110 detects a GET packet from the client 30, and then the transmission module 150 transmits the network parameters of the network device 10 to the client 30.
In step S308, the detecting module 110 detects a SET packet from the client 30, and then the parameter setting module 160 sets network parameters of the network device 10 and the client 30.
In step S310, the detecting module 110 detects a SAVE packet from the client 30, and then the storage requesting module 170 requests the parameter setting module 140 to store the network parameters set by the parameter setting module 160.
In step S312, the detecting module 110 detects a REBOOT packet from the client 30, and then the reboot module 180 reboots the network device 10 and the client 30.
In step S3042, the network-segment determining sub-module 1202 checks whether the client 30 is in a valid network segment. If the client 30 is in a valid network segment, the process proceeds to step S3044. If the client 30 is not in a valid network segment, the process returns to step S302.
In step S3044, the session sub-module 1204 establishes a session with the client 30 in a valid network segment.
In step S3046, the detecting module 110 detects a packet from the client 30 via the port.
In step S3048, the parsing sub-module 1206 parses the packet, to determine whether the packet includes user information. If the packet includes the user information, the process proceeds to step S3050. If the packet does not include the user information, the process returns to step S3046.
The information checking sub-module 1208 checks whether the packet includes correct user information. If the packet includes correct user information, the process proceeds to step S314. If the packet does not include correct user information, the process returns to step S3046. Note that the steps S302 and S306 in
In step S3062, the detecting module 110 detects a packet from the client 30 via the port.
In step S3064, the packet determining module 130 determines whether the packet is the GET packet. If the packet is the GET packet, the process proceeds to step S3066. If the packet is not the GET packet, the process returns to step S3062.
In step S3066, the transmission module 150 transmits the GET response packet to the client 30. Note that the steps S304 and S308 in
In step S3082, the detecting module 110 detects a packet from the client 30 via the port.
In step S3084, the packet determining module 130 determines whether the packet is the SET packet. If the packet is the SET packet, the process proceeds to step S3086. If the packet is not the SET packet, the process returns to step S3082.
In step S3086, the parameter setting module 160 sets the network parameters of the network device 10 and the client 30 according to the SET packet.
In step S3088, the transmission module 150 transmits the SET response packet to the client 30. Note that the steps S306 and S310 in
In step S3102, the detecting module 110 detects a packet from the client 30 via the port.
In step S3104, the packet determining module 130 determines whether the packet is the SAVE packet. If the packet is the SAVE packet, the process proceeds to step S3106. If the packet is not the SAVE packet, the process returns to step S3102.
In step S3106, the storage requesting module 170 requests the parameter storage module 140 save the network parameters of the network device 10 and the client 30 according to the SAVE packet.
In step S3108, the transmission module 150 transmits the SAVE response packet to the client 30. Note that the steps S308 and S312 in
In step S3122, the detecting module 110 detects a packet from the client 30 via the port.
In step S3124, the packet determining module 130 determines whether the packet is the REBOOT packet. If the packet is the REBOOT packet, the process proceeds to step S3126. If the packet is not the REBOOT packet, the process returns to step S3122.
In step S3126, the transmission module 150 transmits the REBOOT response packet to the client 30.
In step S3128, the reboot module 180 reboots the network device 10 and the client 30 according to the REBOOT packet.
Number | Date | Country | Kind |
---|---|---|---|
095114368 | Apr 2006 | TW | national |