CN100589495C - Method for receiving data in link layer - Google Patents

Method for receiving data in link layer Download PDF

Info

Publication number
CN100589495C
CN100589495C CN200410071820A CN200410071820A CN100589495C CN 100589495 C CN100589495 C CN 100589495C CN 200410071820 A CN200410071820 A CN 200410071820A CN 200410071820 A CN200410071820 A CN 200410071820A CN 100589495 C CN100589495 C CN 100589495C
Authority
CN
China
Prior art keywords
frame
data
stage
link layer
network
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.)
Expired - Fee Related
Application number
CN200410071820A
Other languages
Chinese (zh)
Other versions
CN1747475A (en
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.)
LG Electronics Tianjin Appliances Co Ltd
Original Assignee
LG Electronics Tianjin Appliances Co Ltd
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 LG Electronics Tianjin Appliances Co Ltd filed Critical LG Electronics Tianjin Appliances Co Ltd
Priority to CN200410071820A priority Critical patent/CN100589495C/en
Publication of CN1747475A publication Critical patent/CN1747475A/en
Application granted granted Critical
Publication of CN100589495C publication Critical patent/CN100589495C/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

A data receiving method of data link layer for the network protocol consisting of physical layer, data link layer and higher layers includes such steps as receiving data frames from physical layer oneby one, storing the received data frames in data packet buffer, judging if a new data frame is received within the particular data frame Time out, and receiving data frame according to the judged result.

Description

Method for receiving data in link layer
One, technical field
The present invention relates to data receive method, relate in particular to a kind of method for receiving data in link layer (DATA RECEIVING METHOD FOR DATA LINKLAYER) that is applicable to the domestic network system of interactive Control Network agreement.
Two, background technology
Home network (home Network) is a kind of network that each digitlization man is electrically connected.By home network, can control the household electrical appliances in the family easily whenever and wherever possible, can bring enjoyment in life.Along with the development of digital massage treatment technology, household electrical appliances such as refrigerator or washing machine are developing into the digitlization home appliance gradually.Along with the fast development of household electrical appliances use system technology and high-speed digital communication technology, the message household electrical appliances of above-mentioned technology are appearring fully utilizing.Under above-mentioned background, domestic network system has appearred.
This home network such as following table 1 can be divided into data network according to the COS that is provided, amusement net and interactive network.
Table 1
Classification Function COS
Data network Network between PC and peripheral equipment Exchanges data, and network service
The amusement net The network of A/V (Audio/Video) equipment room Music, services such as animation
Interactive network The home appliance Control Network The control of home appliance, automation appliance, Long-distance Control, messenger service etc.
Here, data network (data network) belongs between PC and the peripheral equipment, for the exchanges data or the network type of providing services on the Internet etc. and to set up.Amusement net (entertainment network) belongs to handles ODO, the home network type of message such as VDO.In addition, interactive network (living network) is meant the network that is controlled to be purpose with automation appliance or Long-distance Control etc. merely.
This domestic network system that is used for family is formed by master control (master) equipment and slave as electric equipment.As electric equipment, main control device controls or shows the state of other electric equipments to other electric equipments.As electric equipment, slave is pressed characteristic or other key elements of electric equipment, the requirement of main control device is replied, and export the state variation message of self.The electric equipment that uses in the specification of the present invention (or new equipment) comprises that not only washing machine, refrigerator etc. are used for the household electrical appliances of above-mentioned interactive network service, the household electrical appliances that also comprise the household electrical appliances that are used for the data network service and be used for the entertainment network service.In addition, also comprise automatic null device of coal gas and automatically-controlled door, electrical equipment such as electric light.
This conventional art can not provide the communication specification of the electric equipment in the domestic network system being fulfiled functions such as control and supervision.In addition, the procotol in the domestic network system of conventional art can not provide effective packet (packet) transfer approach.
Three, summary of the invention
Main purpose of the present invention is to overcome the above-mentioned shortcoming that existing product exists, and provide a kind of method for receiving data in link layer (DATA RECEIVING METHOD FOR DATA LINK LAYER), provide a kind of meeting that the household electrical appliances in the domestic network system are controlled and the communication specification of function such as supervision, i.e. data receive method in the data link layer of Network Control Protocol.
Another object of the present invention utilizes the Frame (frame) that receives to form a packet for the data receive method in a kind of data link layer is provided, and receives only a plurality of Frames.
Another purpose of the present invention behind a plurality of Frames of the corresponding packet of reception, when forming a plurality of packets, prevents the reception and/or the storage of supplemental data frame for the data receive method in a kind of data link layer is provided.
The objective of the invention is to realize by following technical scheme.
The data receive method of data link layer of the present invention comprises by in physical layer, data link layer and the high-rise procotol that constitutes, from physical layer stage of receiving data frames one by one; The Frame that receives is stored into the stage of datagram buffer (buffer); From receiving last Frame, in specific Frame allows blanking time (Frame Time Out), to whether receiving new Frame, the 1st judgement stage of judging; According to the 1st judgement stage, finish the stage of receiving data frames, in the 1st judgement stage, in Frame allows blanking time, when not receiving new Frame, the stage that finishes to receive; In the 1st judgement stage, in Frame allows blanking time, when receiving new Frame, carry out storage stage, interval between last transmit data frames of data link layer and the new transmit data frames as Frame at interval, data link layer allows Frame interval and Frame compare blanking time, allow blanking time as the data frame period less than Frame, just from receiving the final data frame, when in Frame allows blanking time, receiving new Frame, Frame that this is last and new Frame are included in the same packet, data link layer receives with the new Frame of storage stage reception and is stored in the datagram buffer, if Frame is identical at interval or allow blanking time greater than Frame, when so new Frame is not transmitted in Frame allows blanking time, the final data frame should be included in the different packets with new Frame, data receive method also comprises the stage of forming packet with the Frame that is stored in described datagram buffer, and the stage that the packet of described composition is sent to high level, data receive method comprises that also described reception ending phase and the described composition Frame between the stage sets the stage of the Frame that can not receive for, data link layer receives end point from Frame, and institute's elapsed time allows blanking time more than the minimum data bag at least.
The data receive method of aforesaid data link layer, wherein special time is that the minimum data bag allows blanking time.
The data receive method of aforesaid data link layer, wherein the minimum data inter-packet gap time is greater than the described high-rise time of described packet to the processing end that finishes to receive.
The data receive method of aforesaid data link layer, wherein procotol is interactive network control protocol (LnCP).
The data receive method of aforesaid data link layer also comprises, to receiving the Frame before the described reception stage, the 2nd judgement stage of judging; As in the 2nd judgement stage, be judged as and can receive, then carry out the described reception stage.
The data receive method of aforesaid data link layer, it is by physical layer, in data link layer and the high-rise procotol that forms, from physical layer stage of receiving data frames one by one; The Frame that has received is stored into the stage of datagram buffer; From receiving last Frame, judge the 1st judgement stage that in specific Frame allows blanking time, whether receives new Frame; Finish the stage of receiving data frames according to the 1st judgement stage.
The data receive method of aforesaid data link layer, wherein program also comprises and could receive the 2nd judgement stage of judging to the Frame before the described reception stage; As in above-mentioned the 2nd judgement stage, being judged as and receiving, then carry out the described reception stage.
The data receive method of aforesaid data link layer, wherein special time is that the minimum data bag allows blanking time.
The data receive method of aforesaid data link layer, wherein the minimum data inter-packet gap time receives described packet to handling the time that finishes greater than described high-rise end.
The data receive method of aforesaid data link layer, wherein procotol is interactive network control protocol (LnCP).
The invention provides electric equipment in the domestic network system is controlled and the data receive method of the data link layer of rule of communication-Network Control Protocol that function such as supervision is suitable for; The Frame that this method has the reception of making forms a packet, receives only mutually the effect of a plurality of Frames that should packet; In addition, after the present invention also has a plurality of Frame that receives only corresponding to a packet, during with a plurality of Frame composition data bag, prevent to receive and/or store the effect of the Frame that appends.
Four, description of drawings
Fig. 1 is a home network block diagram of the present invention.
Fig. 2 is an interactive network control protocol block diagram of the present invention.
Fig. 3 a and Fig. 3 b are the interface block diagram of each interlayer of Fig. 2.
Fig. 4 a to 4f is the interface detailed diagram of Fig. 3 a and 3b.
Fig. 5 is the data receive method flow chart of data link layer of the present invention.
The Frame schematic diagram of Fig. 6 for handling by data receive method of the present invention.
Critical piece label among the figure:
1 domestic network system, 2 internets, 3LnCP server, 4 customer equipments, 10 gateways, 20 to 23 network managers, 30,31:LnCP router, 40 to 49: electric equipment.
Five, embodiment
To achieve these goals, the data receive method in the data link layer provided by the invention comprises four-stage, that is, and and in physical layer and data link layer and the high-rise procotol that constitutes, from above-mentioned physical layer stage of receiving data frames one by one; The Frame of above-mentioned reception is stored into the stage of datagram buffer (buffer); Receive last Frame and begin, in specific Frame allows blanking time, judge whether to receive the 1st judgement stage of new Frame; Finish the stage of receiving data frames according to above-mentioned the 1st judgement stage.
In above-mentioned the 1st judgement stage, in Frame allows blanking time, when not receiving new Frame, finish the reception stage; In the 1st judgement stage, when new Frame is received in Frame allows blanking time, should carry out storage stage.
In addition, above-mentioned data receive method should append and comprise for the 2nd judgement stage, and the 2nd judgement stage could receive the stage of judging to Frame before being the reception stage, as in the 2nd judgement stage, was judged as in the time of can receiving, and should fulfil the reception stage.Above-mentioned data receive method also should append the stage and the packet of forming that comprise with the Frame composition packet that is stored in datagram buffer and be sent to the high-rise stage.Data receive method also should append and comprise that a reception ending phase and the Frame of composition between the stage are set at the stage that can not receive.After data receive method also should append and be included in transfer phase,, Frame is set at the stage that can receive through behind the special time.
Above-mentioned special time should be that the minimum data bag allows blanking time (MinPktInterval).
The above-mentioned minimum data inter-packet gap time should finish to receive the time of packet to the processing end greater than high level.
Above-mentioned procotol should be interactive network control protocol (LnCP).
In addition, the program that storing media stores of the present invention has computer to distinguish, Storage Media of the present invention is in physical layer, in data link layer and the high-rise procotol that forms, the program of the data receive method of data link layer.Said procedure should comprise from physical layer stage of receiving data frames one by one; reach the Frame that has received is stored into the stage that data are protected buffer; and receive from last Frame, judge the 1st judgement stage that in specific Frame allows blanking time, whether receives new Frame.Also should comprise, finish the stage of receiving data frames according to above-mentioned the 1st judgement stage.
Below, by embodiments of the invention and accompanying drawing, domestic network system of the present invention is elaborated.Indubitable, scope of the present invention is not subject to following embodiment and accompanying drawing.Interest field of the present invention should make an explanation based on accompanying right request scope.
Fig. 1 is the block diagram of domestic network system of the present invention.
As shown in Figure 1, domestic network system 1 is connected to LnCP server 3 by internet network 2.Customer equipment 4 is connected to LnCP server 3 by internet network 2 in addition.That is, domestic network system 1 is connected into pass-along message mutually to LnCP server 3 and/or customer equipment 4.
The external network of domestic network system 1 comprises internet network 2, and the kind of the network based customer equipment 4 of said external also can possess miscellaneous equipment.That is, be example with this internet network 2, customer equipment 4 possesses Web server (Websever) (not shown) during for computer, and customer equipment 4 possesses the communication server (Wap sever) (not shown) during for the networking telephone.
LnCP server 3 is connected to domestic network system 1 and customer equipment 4 respectively by specific registration and deregistration procedure, receives supervision and control command etc. from customer equipment 4, and the message by internet network 2 usefulness particular forms is sent to domestic network system 1 again.In addition, LnCP server 3 receives and stores the message of particular form or it is sent to customer equipment 4 from domestic network system 1.In addition, LnCP server 3 stores self or the message of generation is sent to above-mentioned domestic network system 1.That is, domestic network system 1 is connected in LnCP server 3, can download the service content that LnCP server 3 is provided.
Domestic network system 1 comprises gateway 10, network manager 20~23, LnCP router three 0,31, LnCP adapter (adapter) 35,36 and a plurality of electric equipment 40~49.Gateway 10 has the function that connects the internet.Network manager 20~23 is fulfiled the environment set of electric equipment 40~49 and management function.The connection that LnCP router three 0,31 is responsible between the transmission medium.LnCP adapter 35,36 can make network manager 22 and electric equipment 46 be connected to transmission medium.
Network in the domestic network system 1 is coupled to each other by each electric equipment 40~49 shared transmission medium to be formed.This transmission medium can utilize the transmission medium (non-standardized transmission medium) of data link layer unnormalizeds such as RS-485 or lower powered RF, maybe can utilize the transmission medium (standardized transmission medium) of normalization such as power line or IEEE802.11.
Network in the domestic network system 1 by with internet network 2 are the networks that are separated from each other.That is, the network in the above-mentioned domestic network system 1 constitutes the separate network that is connected by wired or wireless transmission medium.Here, though separate network comprises the network that the coupled situation that is in is physically separated in theory.
Domestic network system 1 comprises master control (Master) equipment, subordinate (Slave) equipment.Main control device can control apparatus equipment 40~49 or is monitored its operating state.Slave can be responded the request of main control device and the variation information of notice oneself state.This main control device comprises network manager 20~23, and slave comprises electric equipment 40~49.This network manager 20~23 comprises the message and the control code of the electric equipment 40~49 that will control, and programmed mode is carried out control operation, or receives after the message of LnCP server and/or customer equipment 4 inputs, carries out control operation.In addition, as shown in the figure, be connected with a plurality of network managers 20~23 o'clock, for carry out and other network manager 20~23 between exchange messages, also for the synchronization of message and control, these network managers 20~23 promptly can be that main control device can be again a slave.Promptly should be a kind of, from physical significance equipment just, but be to have master control simultaneously and from the equipment (being compatible equipment) of the function of dominant in theory.
In addition, these network managers 20~23 and electric equipment 40~49 can directly be connected on the network (power line network as shown, RS-485 network, RF network).In addition, can also connect by LnCP router three 0,31 and/or LnCP network adapter 35,36.
In addition, electric equipment 40~49 and/or LnCP router three 0,31 and/or LnCP network adapter 35,36 are registered on the network manager 20~23, and according to product information, receive unique theoretical address (for example 0x00,0x01 etc.).This theoretical address and product code (for example air-conditioning is ' 0x02 ', and washing machine is ' 0x01 ') in conjunction with after, use as node address (Node Address).For example, the identical node address by 0x02009 (air-conditioning 1) and 0x0201 (air-conditioning 2) is by electric equipment 40~49 and/or LnCP router three 0,31 and/or 35,36 identifications of LnCP network adapter.In addition, can also use the group address that is provided with by specific benchmark (product of the same race, product position, user etc. are set), can the more than one electric equipment 40~49 of disposable identification and/or LnCP router three 0,31 and/or LnCP network adapter 35,36 when using the group address.In this group address, this dominance group address is group (cluster) address of a plurality of customer equipment of appointment when being set at " 1 " address choice value (following is mark flag) in the dominance group address.The tacit declaration group address is added to " 1 " to all bits (byte) value of theoretical address and/or product code, and then can specify a plurality of customer equipments.Here, it is to be noted especially and be commonly referred to group's sign indicating number expressing the group address.
Fig. 2 is interactive network control protocol of the present invention (LnCP) block diagram.Domestic network system 1 can make network manager 20~23 by the interactive network control protocol (LnCP) among Fig. 2, and LnCP router three 0,31 transmits message mutually between LnCP network adapter 35,36 and the electric equipment 40~49.And then, network manager 20~23, LnCP router three 0,31, LnCP network adapter 35,36 and electric equipment 40~49 are carried out network service by this LnCP.
As shown in Figure 2, LnCP comprises application software 50, application layer 60, network layer 70, data link layer 80, physical layer 90 and instrumental variable management level 100.Application software 50 is brought into play network managers 20~23, LnCP router three 0,31, LnCP network adapter 35,36, is reached the inherent function of electric equipment 40~49.And the function that connects with application layer 60 is provided, so that on network, carry out remote operation and supervision.Application layer 60 provides service to the user, and has message that the user is provided or order and form the function that is communicated to low layer after the message.Network layer 70 can be network manager 20~23, LnCP router three 0,31, and connecting between LnCP network adapter 35,36 and the electric equipment 40~49 is reliable network.Data link layer 80 provides the connection controlled function, is used to connect the common transmitted medium.Physical layer 90 provides network manager 20~23, LnCP router three 0,31, the rule of the physical interface between LnCP network adapter 35,36 and the electric equipment 40~49 and the bit (byte) that will transmit.The instrumental variable (node parameter) of the node that uses in instrumental variable management level 100 each layers of management configuration.
Detailed says, application software 50 also comprises network management subsidiary layer 51.Network management subsidiary layer 51 has the management node instrumental variable, and management is connected in the network manager 20~23 on the network, LnCP router three 0,31, the function of LnCP network adapter 35,36 and electric equipment 40~49.That is, this network management subsidiary layer 51 has a kind of function, can pass through instrumental variable management level 100, sets the instrumental variable numerical value or the variable that utilizes the medium instrumental variable is managed.When the equipment that is applicable to LnCP was main control device, this network management subsidiary layer 51 also has fulfiled the function that constitutes network or supervising the network.
In addition, network layer 70 also comprises domestic code control subsidiary layer 71.Net connection has network manager 20~23, LnCP router three 0,31, LnCP network adapter 35,36 and electric equipment 40~49.When utilize power line or IEEE 802.11, non-independent shape transmission medium such as wireless (for example LnCP comprise power line communication (PLC) agreement/or during wireless (wireless) agreement) when constituting above-mentioned network, in order to divide each network in theory, the function of domestic code and managing family sign indicating number is set in 71 performances of domestic code control subsidiary layer.This domestic code control subsidiary layer 71, is not included among the LnCP during from physical significance separation individual networks by independent shape transmission mediums such as picture RS-485.This domestic code is formed with 4 bytes (byte), is set at random (random) value or user's set point.
Fig. 3 a and Fig. 3 b are the block diagram of interface of the interlayer of Fig. 2.
The interface schematic diagram of the interlayer when Fig. 3 a is depicted as physical layer 90 and is connected to non-self transmission medium.Shown in Fig. 3 b is the interface schematic diagram of the interlayer of physical layer 90 when being connected to the self transmission medium.
Domestic network system 1 is added to the head (header) of each layer needs and tail (trailer) message from the procotol message unit (Protocol Data Unit:PDU) that high level receives, and is being communicated to low layer.
As shown in the figure, APDU (Application layer PDU) is the data value (data) that transmits between application layer 60 and the network layer 70.NPDU (Network Layer PDU) is the data value that transmits between network layer 70 and data link layer 80 or the domestic code subsidiary layer 71.HCNPDU (Home Code ControlSublayer PDU) is the data value that transmits between network layer 70 (the definite domestic code subsidiary layer 71 of saying so) and data link layer 80 or the domestic code subsidiary layer 71.Press data value (data) between data link layer 80 and the physical layer 90, Frame unit forms interface.
Fig. 4 a to 4f is the detailed diagram of the interface of Fig. 3 a and 3b.
Fig. 4 a is depicted as the APDU structure in application layer 60.
AL (APDU Length) territory is the territory of the length (AL is to the length of Frame group) of expression APDU, and minimum value is that 4 maximums are 77.
AHL (APDU Header Length) territory be the expression APDU head (header) length (AL is to the length of ALO), the territory, be 3 bytes when not expanding, can expand to 7 bytes.For the encipherment of Frame group, can expand to 7 bytes in the LnCP procotol in order to change APDU heads (header) such as application protocol.
ALO (Application Layer Option) territory is the territory that is used for extended message 3, and when for example this territory was set to " 0 ", Message Processing was out in the cold when other value was housed.
The Frame group is processing user's the control messages or the territory of event message, and its structure changes along with the variation of the contained value of ALO.
Fig. 4 b is the structure of the NPDU in the network layer 70, and Fig. 4 c is the detailed structure schematic diagram of the NLC among the NPDU.
SLP (Start of LnCP Packet) territory is the domain of expression packet, and its value is 0x02.
The territory of DA (Destination Address) and SA (Source Address) is the destination of the packet that will transmit and the node address of the side of delivering letters, and each is made of 16 bits.Here the highest 1 bit is for showing the mark (flag) of group address, and the kind (product code) that ensuing 7 bits are product is hanged down 8 bits and comprised the theoretical address of getting.Have the network manager 20~23 of a plurality of same kinds or electric equipment 40~49 o'clock, above-mentioned low 8 bits are used to divide above-mentioned each network manager 20~23 or electric equipment 40~49.
PL (Packet Length) territory is for showing the territory of the NPDU length overall that will transmit, and its minimum value is 12 bytes, and maximum is 100 bytes.
SP (Service Priority) territory is to transmit the territory that message transmits priority bit, is made of 3 bits.Each transmits the priority picks such as the table 2 of message.
When the subordinate customer equipment is replied the request of master control customer equipment, the priority picks of the request message that retinue's master control customer equipment receives.
Table 2
The priority picks Value Be suitable for (Application Layer)
High (High) 0 -when transmitting emergency message
In (Middle) 1 -when transmitting the general data bag-during the event message of the online and non-presence of transmissions map network (Online State) (Offline State) variation
Standard (Normal) 2 -when transmitting notice and constituting the message of network-during transmission common event message
Low (Low) 3 -when transmitting the value according to the producer that downloads or upload
NHL (NPDU Header Length) territory is to be used for expanding the territory that NPDU head (header) (the NLC territory of SLP) uses, and is 9 bytes when not expanding, and maximum can expand to 16 bytes.
PV (Protocol Version) territory is the territory that shows 1 byte of the network protocol version that is adopted, and is made of high 4 bits and low 4 bits.High 4 bits are version (version) territory, and low 4 bits are server version (sub-version) territory.Version (version) and server version (sub-version) are respectively with 16 systems mark method version of display.
NPT (Network layer Packet Type) territory is 4 bit field of dividing data bag kind in network layer.LnCP comprises request data package (Request Packet), reply data bag (ResponsePacket), notification data bag (Notification Packet).The NPL territory of master control customer equipment should be set at request data package or notification data bag, and the NPL territory of slave should be set at reply data bag or notification data bag.The NPT value of packet kind is as shown in table 3 below.
Table 3
Value Explanation
0 Request data package
1~3 Do not use
4 The reply data bag
5~7 Do not use
8 The notification data bag
9~12 Do not use
13~15 The interface that connects with domestic code control subsidiary layer is worth with reservation
TC (Transmission Counter) territory is a network layer generation communication failure, in the time of can not successfully sending request data package or reply data bag, in order to improve the success rate that transmits request data package or reply data bag, transmission or 2 bit field of transmission more repeatedly.The destination can utilize the numerical value in TC territory, detects repetition message.With the scope of the TC thresholding of NPT value with following table 4.
Table 4
The packet kind Value (scope)
Request data package 1~3
The reply data bag 1
The notification data bag 1~3
PN (Packet Number) territory is made of 2 bits.In slave, be used with TC in order to detect repetitive data packet PN (Packet Number) territory.In the master control customer equipment, be used in order to handle a plurality of communication cycles.Scope with the PN territory of NPT value is as shown in table 5 below.
Table 5
The packet kind Value (scope)
Request data package 0~3
The reply data bag The PN thresholding of duplicate requests packet
The notification data bag 0~3
The APDU territory is the unit of the Internet protocol data value (data) of the application layer of transmission between application layer 60 and the network layer 70.The APDU minimum value is 0 byte, and maximum is 88 bytes.
CRC (Cyclic Redundancy Check) territory is 16 bit field for the mistake that detects data accepted bag (SLP is to the APDU territory).
ELP (End of LnCP Packet) territory is the territory of video data Bao Weiduan, and its value is 0x03.If receive with the data packet length territory in length corresponding data values (data), can not detect the ELP territory, then be shown packet error.
Fig. 4 d is the HCNPDU structure chart in the domestic code control subsidiary layer 71.
As shown in the figure, the high part of NPDU also comprises HC (Home Code) territory.
The numerical value of this domestic code is made of 4 bytes.This domestic code has unique value in the distance of the propagable circuit of packet.
Fig. 4 e is depicted as the structure of the Frame in the data link layer.
Head of the Frame of the data link layer of LnCP (header) and tail (trailer) form different structures according to transmission medium.When data link layer 80 was used the transmission medium of unnormalized, head of Frame (header) and tail should have Null territory (Null Field).As use normalized transmission medium, then with the regulation of procotol.The NPDU territory is the unit from the data value of high network layer 70 transmission.The data value unit that HCNPDU used when being physical layer 90 for non-independent shape transmission medium such as power line or IEEE 802.11 is the data value unit of appending 4 byte domestic codes at the NPDU front end.Data link layer 80 is not divided the processing of NPDU and HCNPDU.
Fig. 4 f is the data frame structure in the physical layer 90.
The physical layer 90 of LnCP has the function that physical signalling is sent to transmission medium.As the physical layer 90 of LnCP procotol, the transmission medium of the unnormalized data link layer 80 that can use be equal to RS-485 or low power RF.Can also use the normalization transmission medium that is equal to as power line or IEEE 802.11.Be suitable in the domestic network system 1 of LnCP network, for network manager 20~23 and electric equipment 40~49 and RS-485 or LnCP router three 0,31, and LnCP adapter 35,36 connect, and have utilized the signal standards (level) of UART (Universal Asynchronous Receiver and Transmitter) data frame structure and RS-232.When utilizing netting twine (serial bus) to connect between each equipment, UART is at communication line control bit signal flow.Shown in Fig. 4 f, in LnCP, the packet that high level is sent here, be transformed into the UART Frame unit of 10 bit sizes after, transmit by transmission medium.The UART Frame is made of the start bit (Start Bit) of 1 bit, the data value (data) of 8 bits and the position of rest (Stop Bit) of 1 bit.Above-mentioned UART Frame does not use effect position (Parity Bit).The UART Frame is passed on from start bit, passes on position of rest at last.When the domestic network system 1 of suitable LnCP utilizes UART, do not use the data frame head (frame header) and the postamble (frametrailer) that append.
Below be to using the explanation of the node instrumental variable in above-mentioned layer.
A kind of corresponding in the form (type) of the data value of following node instrumental variable and a plurality of forms down shown in Figure 6.
Table 6
Mark Form Explanation
char signed char When not expressing the length of value (data) is 1 byte
uchar unsigned char When not expressing the length of value (data) is 1 byte
int signed int When not expressing the length of value (data) is 2 bytes
uint unsigned int When not expressing the length of value (data) is 2 bytes
long signed long When not expressing the length of value (data) is 4 bytes
ulong unsigned long When not expressing the length of value (data) is 4 bytes
string string Last byte is the text line data of NJLL
FILE - Data with file structure
Data link layer 80 regulations are for the control medium that are connected to the common transmitted medium connect (MediumAccess Control:MAC) function.When using the transmission medium of unnormalized, use as the p-DCSMA (probabilistic-Delayed Carrier Sense MultipleAccess) of control near the procotol (Medium Access ControlProtocol) of medium with the same data link layer 80 of RS-485.During the identical normalization transmission medium of electrification line or IEEE 802.11, with corresponding network protocol specifies.
Table 7 is in the data link layer 80 of using the UART Frame, the value of the node instrumental variable (NodeParameter) of use.The time of each variable is that benchmark is set when being 4800bps with the transmission speed of physical layer 90.At this moment 1IUT (Information Unit Time) is calculated as 2.1ms.
Table 7
Fig. 5 is the precedence diagram of the data receive method of data link layer of the present invention.
Detailed says, in the stage (S51), before physical layer 90 transmit data frames or during transmit data frames, the state of judgment data link layer 80 whether be in can receiving data frames state.At this moment, when if data link layer 80 generates other packet or is transmitting (receiving between the following stage (S56 to S58)) with the Frame that has received, be judged as and receive and to finish transmission, do not handle the Frame that has received, carry out the stage (S52) otherwise just be judged as to receive.
In the stage (S52), data Layer 80 receives the Frame that has transmitted and is stored into datagram buffer.Data Layer 80 receives from physical layer 90 in regular turn for handle, and desire forms a plurality of Frames of a packet, is stored into datagram buffer, and data receive method comprises the stage (S53).
In the stage (S53), data link layer 80 allows interval between last transmit data frames and the new transmit data frames (hereinafter referred to as " Frame at interval ") and Frame compare blanking time.Allow blanking time as the data frame period less than Frame, promptly from receiving the final data frame, when receiving new Frame in Frame allows blanking time, Frame that this is last and new Frame should be included in the same packet.So carrying out the new Frame of stage (S52) reception, data link layer 80 is stored in the datagram buffer.If Frame is at interval identical or allow blanking time greater than Frame, when promptly new Frame was not transmitted in Frame allows blanking time, the final data frame should be included in the different packets with new Frame.So data link layer 80 is carried out the stage (S54) after the final data frame is stored into datagram buffer.
In stage (S54), data link layer 80 allows Frame to be shown with interior Frame blanking time at Frame at interval and is included in a packet, finishes from physical layer 90 receiving data frames.
In stage (S55), the Frame that 80 pairs of physical layers 90 of data link layer are appended is set at and can not receives.This setting and stage (S58) begin to keep at least the minimum data bag from Frame reception end point and allow blanking time, can prevent to cover on the datagram buffer new Frame.
In stage (S56), data link layer 80 usefulness are stored in the Frame composition data bag (NPDU) of datagram buffer.
In stage (S57), data link layer 80 is sent to high-rise network layer 70 to the packet (NPDU) that constitutes.
In stage (S58), data link layer 80 makes from Frame and receives end point, and institute's elapsed time allows blanking time more than the minimum data bag at least.In the stage (S59), the Frame that physical layer 90 is transmitted is set at and can not receives.Can be made as later on and can receive new Frame and can the composition data bag.
At this moment, the minimum data bag allows to be set at blanking time the point that finishes than the message sink from data link layer 80, and composition data bag (NPDU) is communicated to the big value in interval between the processed intact point of application layer 60 by network layer 70.Like this, after handling the Frame or packet that has received, can receive new Frame or packet, and can make at same layer a plurality of Frames or processing data packets are received and transmit and can not carry out simultaneously, and then can carry out stable reception to the Frame that received or packet and handle and transmit.
The software forms that this data receive method is made with specific program can be stored into specific storage member or Storage Media.
Figure 6 shows that the Frame of handling with data receive method of the present invention.
As shown in Figure 6, packet (A) comprises Frame (f1~f16).Data link layer 80 receives (stage (S52)) from the Frame of initial transmission, this Frame becomes the final data frame (f1) that has now received, from the received point of this final data frame (f1), in allowing blanking time, Frame receives new Frame (stage S53).This process (stage (S52) reaches (S53)) repetitiousness always proceeds to till this Frame of reception (f16).Because of Frame (f8) and the Frame (f9) bigger at interval than other Frame at interval, but allow blanking time little, so (f8) and (f9) be included in same packet (A) than Frame.
In addition, after data link layer 80 receives last Frame (f16), in allowing blanking time, Frame do not have the new Frame that receives, so packet (A) includes only (f16) (stage (S54)).
In addition, data link layer 80 composition data bags (A) transmit, and when packet allows blanking time greater than the minimum data bag at interval, receive new Frame (' f1) packet (B) that formation is new.
The invention has the beneficial effects as follows: the invention provides electric equipment in the domestic network system is controlled and the data receive method of the data link layer of rule of communication one Network Control Protocol that function such as supervision is suitable for; The Frame that this method has the reception of making forms a packet, receives only mutually the effect of a plurality of Frames that should packet; In addition, after the present invention also has a plurality of Frame that receives only corresponding to a packet, during with a plurality of Frame composition data bag, prevent to receive and/or store the effect of the Frame that appends.
The above, it only is preferred embodiment of the present invention, be not that the present invention is done any pro forma restriction, every foundation technical spirit of the present invention all still belongs in the scope of technical solution of the present invention any simple modification, equivalent variations and modification that above embodiment did.

Claims (5)

1, a kind of data receive method of data link layer comprises by in physical layer, data link layer and the high-rise procotol that constitutes, from described physical layer stage of receiving data frames one by one; The Frame of described reception is stored into the stage of datagram buffer (buffer); From receiving last Frame, in specific Frame allows blanking time (Frame Time Out), to whether receiving new Frame, the 1st judgement stage of judging; According to the 1st judgement stage, finish the stage of receiving data frames, it is characterized in that:
In described the 1st judgement stage, in Frame allows blanking time, when not receiving new Frame, carry out the stage that described end receives; In described the 1st judgement stage, in Frame allows blanking time, when receiving new Frame, carry out described storage stage,
Interval between last transmit data frames of described data link layer (80) and the new transmit data frames as Frame at interval, data link layer (80) allows Frame interval and Frame compare blanking time, allow blanking time as the data frame period less than Frame, just from receiving the final data frame, when in Frame allows blanking time, receiving new Frame, Frame that this is last and new Frame are included in the same packet, data link layer (80) receives with the new Frame of storage stage reception and is stored in the datagram buffer, if Frame is identical at interval or allow blanking time greater than Frame, when so new Frame is not transmitted in Frame allows blanking time, the final data frame should be included in the different packets with new Frame
Described data receive method also comprises the stage of forming packet with the Frame that is stored in described datagram buffer, and the packet of described composition is sent to the high-rise stage,
Described data receive method comprises that also described reception ending phase and the described composition Frame between the stage sets the stage of the Frame that can not receive for,
After described data receive method also is included in and carries out described transfer phase,, Frame is set for stage of the Frame that can receive through behind the special time,
Data link layer (80) receives end point from Frame, and institute's elapsed time allows blanking time more than the minimum data bag at least.
2, the data receive method of data link layer according to claim 1 is characterized in that: described data receive method also comprises, to receiving the Frame before the described reception stage, the 2nd judgement stage of judging; As in the 2nd judgement stage, be judged as and can receive, then carry out the described reception stage.
3, the data receive method of data link layer according to claim 1 is characterized in that: described special time is that the minimum data bag allows blanking time.
4, the data receive method of data link layer according to claim 3 is characterized in that: the described minimum data inter-packet gap time is greater than the described high-rise time of described packet to the processing end that finishes to receive.
5, the data receive method of data link layer according to claim 1 is characterized in that: described procotol is interactive network control protocol (LnCP).
CN200410071820A 2004-09-06 2004-09-06 Method for receiving data in link layer Expired - Fee Related CN100589495C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN200410071820A CN100589495C (en) 2004-09-06 2004-09-06 Method for receiving data in link layer

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN200410071820A CN100589495C (en) 2004-09-06 2004-09-06 Method for receiving data in link layer

Publications (2)

Publication Number Publication Date
CN1747475A CN1747475A (en) 2006-03-15
CN100589495C true CN100589495C (en) 2010-02-10

Family

ID=36166796

Family Applications (1)

Application Number Title Priority Date Filing Date
CN200410071820A Expired - Fee Related CN100589495C (en) 2004-09-06 2004-09-06 Method for receiving data in link layer

Country Status (1)

Country Link
CN (1) CN100589495C (en)

Also Published As

Publication number Publication date
CN1747475A (en) 2006-03-15

Similar Documents

Publication Publication Date Title
CN1799224B (en) Home network system
KR100596755B1 (en) Home network system
US8031724B2 (en) Home network system
KR100996309B1 (en) Network device
KR100638030B1 (en) Network electric device
US20060251086A1 (en) Home network system
CN100534074C (en) Home network system
US7844680B2 (en) Home network system
US7668074B2 (en) Home network system
CN100589495C (en) Method for receiving data in link layer
KR100605219B1 (en) Network electric device
CN100471146C (en) Household network system
CN1938988A (en) Home network system
CN1747477B (en) Data process in network layer
CN100466568C (en) Household network system and its address setting method and associated electrical appliance equipment
CN1747478B (en) Data process in network layer
CN1938986A (en) Data processing method for application layer

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
C17 Cessation of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20100210

Termination date: 20120906