If I want to connect a IBM mainframe with a leased line for Internet, which device should I use for the leased...
line to modem - to router - to mainframe? And from mainframe to router to connect all other LAN's in the buildings.
If there are two different networks like Ethernet and token ring connected with the two different workstations then is it better to use gateway or bridge for communication?
You really have two related questions here so I'll answer them separately.
First, regarding leased line access to the Internet and connecting mainframes:
It isn't completely clear from your question what all the variables are. Like any consultant, I would have many more questions about priorities, costs, and requirements. But let's assume that the facts simply are that your Internet access is leased line, you have LANs with other networked devices and a mainframe, and these are all inescapable terms in the equation.
The simple answer is, as you suggested, leased line to modem to router to mainframe, with the other LANs hanging off the router as well. Other solutions exist but it rapidly becomes a religious issue which solution is best for you.
A potential issue is the cost of a NIC for the mainframe - they can cost tens of thousands of dollars and may raise cost-effectiveness issues. However, from your second question it sounds like you already have a Token Ring interface for the mainframe.
In which case, your second question is very important.
Second, regarding the inter-connection of Ethernet and token ring:
Please, please, please.... use a gateway or at least pay extra special attention to the MTU. One of the most often cited problems discovered when mixing Layer 2 protocols is MTU conflicts. Even Fast Ethernet meeting gigabit Ethernet has this issue. Why?
MTU is the Maximum Transmission Unit, expressed in terms of the Layer 2 payload (e.g. not including the Layer 2 header) that is the packet at Layer 3. The standard maximum MTU varies from protocol to protocol. For example, RFC 894 and 895 define 1500 bytes for Ethernet, RFC 1042 defines 4464 bytes for (4 Mbit) Token Ring and IBM uses 17914 bytes for its (16 Mbit) Token Ring. Meanwhile, gigabit Ethernet doesn't have any standard size, with values ranging from around 5000 bytes to over 16 kbytes!
And what is the problem?
It is widely believed that fragmentation will take care of any differences in MTU between networks. However there are a range of implementations that violate that assumption. For example, some applications use the "Don't Fragment" bit in their headers to avoid fragmentation. And some interfaces, especially older ones, just throw away packets that are too big without further response. And even if fragmentation does work, it can place a tremendous burden on the mediating device as it breaks down oversize packets and generates the fragmented packets. Ideally, every application should take advantage of path MTU discovery, as defined by RFC 1191, to determine the largest packets that can be sent end-to-end.
As much care should be taken setting the MTU of network interfaces as is given to setting the network mask. Much agony later on can be avoided by establishing good habits early with regard to MTU. Make sure that interconnected interfaces are manually set to the same MTU; make sure that interconnections between domains with different protocols/MTUs are maintained with smart, well-managed devices such as gateways that are properly provisioned; ensure that NICs are RFC-compliant and handle MTU and fragmentation properly.
So maybe the answer to your first question should be, leased line to modem to router to gateway to mainframe, with LANs hanging off the router.
For more information on MTU conflicts, see the white paper on MTU at http://www.jaalam.com/wp/.