How does Arducopter SITL work in Ardupilot?

I have gone through the SITL architecture and I just want to cross check whether I understand it right or not?

There is a FDM which solves the 6 DOF equation of your model and it is connected to the Ardupilot Autopilot through UDP ports.

And The GCS is also connected to the Ardupilot Autopilot on the other hand through TCP serials to give the user input.

Now here how it works, if a user will give the input from the GCS and that input will be sent or communicated through TCP serial ports to the Ardupilot Autopilot firmware (Desktop executable).

On the basis of user input, the autopilot will take the decision and feed the response to the FDM or Simulation of your model through UDP port which can be visible by connecting the FDM to the 3d simulator (Flight gear) through again UDP.

So that’s what I understand from the architecture. Please tell me if I am wrong in something.

And one more thing this UDP & TCP protocol will be replaced by the Mavlink protocol in the case of real drone.

Hello,
Have you looked at this ?
https://ardupilot.org/dev/docs/sitl-simulator-software-in-the-loop.html

The SITL (software in the loop) simulator allows you to run Plane, Copter or Rover without any hardware. It is a build of the autopilot code using an ordinary C++ compiler, giving you a native executable that allows you to test the behaviour of the code without hardware.

And this
http://mavlink.io/en/

MAVLink is a very lightweight messaging protocol for communicating with drones

UDP&TCP are transport layers allowing communication between networked devices. They can transport any data, like images or Mavlink Messages.