Interfaces

Symbol

The diagram below shows the VCC symbol used to represent the IP protocol implementation created for this project which can be found in the 'IP_Protocol' block of the 'MooToothWorkspace2' workspace. (Apologies for the truncation of port names, but VCC seems to not want to draw the full names under any circumstances!)

The 'IP_TCP_HANDLER' block is designed to act as an abstraction of the process of sending data through IP. Since it is possible for a number of different protocols to send and receive data via IP (TCP, UDP, etc.), a block of this type can be created for each such protocol to perform any operations on the data necessary for its transmission via IP. The 'IP_PPP_HANDLER' block is responsible for actually sending the data directly to the PPP layer, and for receiving data packets from PPP, and passing them to the correct abstraction block (IP_TCP_HANDLER in this case). The Multiplier block is simply used to generate 'Clear_to_send' signals for IP. This 'clear_to_send' mechanism was required through many layers of the stack to let the protocols know when it is safe to send their next segment of data. Without this, there is the possibility of databuffers used within the Whitebox C models of the blocks could be overwritten prematurely , causing the wrong data to be transmitted. In operation, the Multiplier simply acts as an AND gate. Its first input is the 'Integer Source' block shown in the diagram, which simply outputs a value of one to the Multiplier. The second input is a clear_to_send signal from the lower level PPP block, which is set to 1 when PPP is ready to receive another packet. When this second input is changed, the output of the multiplier is sent to the IP, thereby informing it whether it is allowed to send more data.


Upper-Level Interface

The following ports are provided for a TCP block to interface with IP:

IP_Send_Port

Direction: Input.

Arguments: TCP_Packet

Operation: This port is used by TCP to send a TCP packet to the other side of a communication, via IP.

IP_Receive_Port

Direction: Output.

Arguments: TCP_Packet

Operation: Once IP has processed a received packet and removed all of the IP headers, it uses this port to send the resulting TCP_Packet up to the TCP block.

ClearToSendOut

Direction: Output.

Arguments: Integer

Operation: Used to inform TCP that IP is ready to receive another packet to send.


Lower-Level Interface

The following ports are provided to allow the IP block to interface with TCP:

Send PPP

Direction: Input.

Arguments: PPP_Packet

Operation: Allows IP to send a PPP_Packet to the lower PPP layer. (A PPP_Packet is simply an IP packet with an extra 2-byte header, which signifies the protocol from which the message was sent.)

Receive PPP

Direction: Input.

Arguments: PPP_Packet

Operation: Used to receive a PPP_Packet, to be processed by the IP layer.

ClearSignal

Direction: Input.

Arguments: Integer

Operation: This is the integer output from the multiplier block, which is used to inform IP whether or not it is currently allowed to send another packet to TCP.