How can be create two nodes (Node_1 & Node_2) and then transfer a packet "P" with attributes User_id, Name, from Node_1 to Node_2. then Node_2 reply back with message "Yes".
Like Ali says above, its easier to use a network simulator than to use MATLAB. But if you still have to use MATLAB its may be worth interfacing the network simulator and MATLAB.