Development of a Simulator for the HANARO Research Reactor (Communication Protocol) 2005.6.27. H.S. Jung
Contents Introduction Network models TCP UDP HLA
Introduction A distributed simulation of a dynamic system consists of a group of components or subsystem simulations that communicate across a network during execution All of the simulations run in parallel and pass data among themselves as needed over the network Simulation Non-real-time simulation The rate of passage in the simulation may be arbitrary Real-time simulation The rate of passage in the simulation may be constrained to match the passage of real time
Introduction Benefits of distributed simulation Non-real-time simulation Speedup Ability to connect multiple simulations Real-time simulation Requirements for communication Correctness Completeness Speed
Network models ISO/OSI Network Model Layer 1 - Physical Physical layer defines the cable or physical medium itself Layer 2 - Data Link Data Link layer defines the format of data on the network. Ethernet addresses a host using a unique, 48-bit address called its Ethernet address or Media Access Control (MAC) address. Layer 3 - Network NFS uses Internetwork Protocol (IP) as its network layer interface. IP is responsible for routing, directing datagrams from one network to another. Layer 4 - Transport Transport layer subdivides user-buffer into network-buffer sized datagrams and enforces desired transmission control. Layer 5 - Session The session protocol defines the format of the data sent over the connections. The NFS uses the Remote Procedure Call (RPC) for its session protocol. RPC may be built on either TCP or UDP. Login sessions uses TCP whereas NFS and broadcast use UDP. Layer 6 - Presentation External Data Representation (XDR) sits at the presentation level. It converts local representation of data to its canonical form and vice versa. The canonical uses a standard byte ordering and structure packing convention, independent of the host. Layer 7 - Application Provides network services to the end-users. Mail, ftp, telnet, DNS, NIS, NFS are examples of network applications
Network models TCP/IP Network Model Layer 1 - Link Layer 2 - Network This layer defines the network hardware and device drivers. Layer 2 - Network This layer is used for basic communication, addressing and routing. TCP/IP uses IP and ICMP protocols at the network layer. Layer 3 - Transport Handles communication among programs on a network. TCP and UDP falls within this layer. Layer 4 - Application End-user applications reside at this layer. Commonly used applications include NFS, DNS, Web, rlogin, talk, and ftp
Network models
TCP/IP Transmission Control Protocol/Internet Protocol A family of communication protocols High-level networking Web FTP Remote login Email Low-level networking Transmission of packets of data between applications on the computers within networks
TCP/IP Architecture Application Application Transport Internetwork Communicates with the transport layer Transport Deliver data to application Error detection and retransmission Internetwork Deliver data to the correct computer IP Network technology A networking hardware Application Internetwork Network technology Transport
Encapsulation of Data
Communication with TCP/IP
Transport Protocols Two primary protocols Reliability of the protocols TCP (Transmission Control Protocol) Point-to-point communication UDP (User Datagram Protocol) Multicast communication Reliability of the protocols Error-free delivery Assured delivery Delivery in the same sequence the data was sent No duplication of delivered data
TCP Connection-oriented protocol Stream-based Point-to-point Similar to telephone Reliable protocol Stream-based Data is a continuous stream of bytes Ordering of data Point-to-point Complexity Traffic Large latency and small jitter Use for non-real-time simulation
UDP Connectionless protocol Datagram-based Multicast Similar to mailbox Not reliable Datagram-based Data is a separate entity No ordering Multicast Simplicity No traffic Small latency and large jitter Use for real-time simulation
Effects of latency Latency degrades the overall performances Use extrapolation to minimize the effects Design data packet : for moving body P(t) V(t) Timestamp Estimation P(t)’=p(t) + (ta-tt)V(t) V(t)’=v(t) + [(ta-tt)/(tt-tp)] [v(tt) - v(tp)]
Lost Packets in UDP Monitoring variables Commands Not critical Updated at next time Commands Critical Use acknowledge method
Application in the simulator Use UDP between simulator and instructor station Data socket server Multicast to the domain of user group Data socket client Connect with IP of the server in the user group domain Use command acknowledge Checks the response and retransmits if no acknowledge is received
HLA HLA (High Level Architecture) A standard for communication among a group of cooperating simulations ( IEEE 1516) A software architecture for creating computer simulations out of component simulations. The HLA provides a general framework within which simulation developers can structure and describe their simulation applications Developed by DoD
HLA HLA Rules Interface Specification Object Model Template (OMT) Ensure proper interaction of federates in a federation Describe the responsibilities of federates and federations Interface Specification Defines Runtime Infrastructure (RTI) services and interfaces Identifies “callback” functions each federate must provide Object Model Template (OMT) Prescribes the format and syntax for recording information Establishes the format of key models Federation Object Model (FOM) Simulation Object Model (SOM) Management Object Model (MOM)
References Jim Ledin, Simulation Engineering, CMP books,2001 IEEE Std 1516-2000, IEEE Standard for Modeling and Simulation (M&S) High Level Architecture (HLA) - Framework and Rules